1. Traversing objects (with additional parameters)
?
|
1
2
3
4 |
$.each (Object, function (P1, p2) {
This This here points to the current property value of the object in each traversal
P1; P2; Accessing additional parameters
}, [' Parameter 1 ', ' parameter 2 ']); |
2. Iterating through an array (with attachment parameters)
?
|
1
2
3
4 |
$.each (Array, function (P1, p2) {
This This here points to the current element of the array in each traversal
P1; P2; Accessing additional parameters
}, [' Parameter 1 ', ' parameter 2 ']); |
3. Traversing objects (no additional parameters)
?
|
1
2
3
4
5 |
$.each (Object, function (name, value) {
This This points to the value of the current property
Name Name indicates the current property of the object
Value Value that represents the current property of the object
}); |
4. Iterate through an array (no additional parameters)
?
|
1
2
3
4
5 |
$.each (Array, function (i, value) {
This This points to the current element
I I represents the array current subscript
Value Value represents the current element of the array
}); |
jquery $.each Traversal