Skip to content

Commit bc773be

Browse files
benjaminpwarrenscottgonzalez
authored andcommitted
Append Outside Loop: Grammar and spelling corrections.
1 parent 0376359 commit bc773be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

page/performance/append-outside-loop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ attribution:
66
- jQuery Fundamentals
77
---
88

9-
Touching the DOM comes at a cost; if you're appending a lot of elements to the DOM, you will want to append them all at once, rather then one at a time. This is common problem when appending elements within a loop.
9+
Touching the DOM comes at a cost. If you're appending a lot of elements to the DOM, you will want to append them all at once, rather than one at a time. This is a common problem when appending elements within a loop.
1010

1111
```
1212
$.each( myArray, function( i, item ) {
@@ -37,7 +37,7 @@ $.each( myArray, function( i, item ) {
3737
$( "#ballers" )[ 0 ].appendChild( frag );
3838
```
3939

40-
Another technique, which is quite simple, is to build up a string during each iteration of the loop. After the loop, just set the HTML of the DOM element to that string.
40+
Another simple technique is to build up a string during each iteration of the loop. After the loop, just set the HTML of the DOM element to that string.
4141

4242
```
4343
var myHtml = "";
@@ -51,4 +51,4 @@ $.each( myArray, function( i, item ) {
5151
$( "#ballers" ).html( myHtml );
5252
```
5353

54-
There are of course other techniques you could certainly test out; a great way to test the performance of these is through a site called [jsperf](http://jsperf.com). This site allows you to benchmark each technique and visually see how it performs across all the browsers.
54+
There are of course other techniques you could certainly test out. A great way to test the performance of these is through a site called [jsperf](http://jsperf.com). This site allows you to benchmark each technique and visually see how it performs across all the browsers.

0 commit comments

Comments
 (0)