Last active
August 29, 2015 14:06
-
-
Save darkmavis1980/e3cc3acc4259042b4a5d to your computer and use it in GitHub Desktop.
Example of the use of .each in jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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