Skip to content

Instantly share code, notes, and snippets.

@darkmavis1980
Last active August 29, 2015 14:06
Show Gist options
  • Save darkmavis1980/e3cc3acc4259042b4a5d to your computer and use it in GitHub Desktop.
Save darkmavis1980/e3cc3acc4259042b4a5d to your computer and use it in GitHub Desktop.
Example of the use of .each in jQuery
var $a = [1,2,3,4];
function parseNumber($data){
$.each($data,function(index, value){
console.log(index + ' ' +value);
});
}
parseNumber($a);
/* It will print:
0 1
1 2
2 3
3 4
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment