mozilla

Compare Revisions

A re-introduction to JavaScript

Change Revisions

Revision 52945:

Revision 52945 by greggman on

Revision 52946:

Revision 52946 by Slosd on

Title:
A re-introduction to JavaScript
A re-introduction to JavaScript
Slug:
Talk:JavaScript/A_re-introduction_to_JavaScript
Talk:JavaScript/A_re-introduction_to_JavaScript
Content:

Revision 52945
Revision 52946
tt34    <h2>
35      Technical misinformation
36    </h2>
37    <h3>
38      Section "Arrays" - suggestions for iterating
39    </h3>
40    <p>
41      The two suggested alternatives not only make the code far m
 >ore unreadable but also isn't based on any messurable benefits. I
 > did a simple test (<a class=" link-https" href="https://gist.git
 >hub.com/1780215" title="https://gist.github.com/1780215">https://
 >gist.github.com/1780215)</a> for the common syntax and these two 
 >suggestions and found almost no improvement in performance.
42    </p>
43    <table border="1" cellpadding="1" cellspacing="1" style="tabl
 >e-layout: fixed; width: 100%;">
44      <tbody>
45        <tr>
46          <td>
47            <div class="logRow logRow-log">
48              <span class="objectBox objectBox-text">Classic for 
 >loop</span>
49            </div>
50          </td>
51          <td>
52            <span class="objectBox objectBox-text">486ms</span>
53          </td>
54        </tr>
55        <tr>
56          <td>
57            <span class="objectBox objectBox-text">For loop with 
 >length cached</span>
58          </td>
59          <td>
60            <span class="objectBox objectBox-text">473ms</span>
61          </td>
62        </tr>
63        <tr>
64          <td>
65            <span class="objectBox objectBox-text">For loop with 
 >short signature</span>
66          </td>
67          <td>
68            <span class="objectBox objectBox-text">468ms</span>
69          </td>
70        </tr>
71      </tbody>
72    </table>
73    <p>
74      Considering that the last example can easily break your loo
 >p at least it should be removed. That is not the way to build rob
 >ust applications.
75    </p>

Back to History