Skip to content

Commit 41b1d05

Browse files
committed
.each -> .each()
1 parent 7625fb2 commit 41b1d05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

page/using-jquery-core/iterating.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jQuery provides an object iterator utility called `$.each()` as well as a jQuery
66

77
### `$.each()`
88

9-
[`$.each`](http://api.jquery.com/jQuery.each/) is a generic iterator function for looping over object, arrays, and array-like objects. Plain objects are iterated via their named properties while arrays and array-like objects are iterated via their indices.
9+
[`$.each()`](http://api.jquery.com/jQuery.each/) is a generic iterator function for looping over object, arrays, and array-like objects. Plain objects are iterated via their named properties while arrays and array-like objects are iterated via their indices.
1010

1111
`$.each()` is essentially a drop-in replacement of a traditional `for` or `for-in` loop. Given:
1212

@@ -237,7 +237,7 @@ Notice the `.get()` chained at the end. `.map()` actually returns a jQuery-wrapp
237237

238238
### [`$.map`](http://api.jquery.com/jQuery.map/)
239239

240-
Like `$.each()` and `.each()`, there is a `$.map()` as well as `.map()`. The difference is also very similar to both `.each` methods. `$.map()` works on plain JavaScript arrays while `.map()` works on jQuery element collections. Because it's working on a plain array, `$.map()` returns a plain array and `.get()` does not need to be called – in fact, it will throw an error as it's not a native JavaScript method.
240+
Like `$.each()` and `.each()`, there is a `$.map()` as well as `.map()`. The difference is also very similar to both `.each()` methods. `$.map()` works on plain JavaScript arrays while `.map()` works on jQuery element collections. Because it's working on a plain array, `$.map()` returns a plain array and `.get()` does not need to be called – in fact, it will throw an error as it's not a native JavaScript method.
241241

242242
A word of warning: `$.map()` switches the order of callback arguments. This was done in order to match the native JavaScript `.map()` method made available in ECMAScript 5.
243243

0 commit comments

Comments
 (0)