$.each (obj, FN)
Each (function (I,item) {})
A general iterative function that can be used to approximate an object and array.
This function differs from $ (). each (), which is a function designed to iterate and execute the jquery object. This function can be used to iterate over any object and array. The callback for this function contains two parameters: the first is a key (object) or index (array), and the second is a value.
return value: Object
Parameters:
Obj (object): objects or arrays to repeat iterations
fn (function): functions to be executed in each object
Example:
This is an example of all the items in an iterative group, where each item and index is accessed through a function.
$.each ([0,1,2], function (i, N) {alert ("Item #" + i + ":" + N);});
Example:
This is an example of all the attributes in an iterative object that accesses the name and value of each property through a function.
$.each ({name: "John", Lang: "JS"}, function (i, N) {alert ("Name: + i +", Value: "+ n";});