Created
November 27, 2017 14:12
-
-
Save seogi1004/1a234df97271211f641249431b2e154a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 each = function(arr, callback) { | |
for(i = 0; i < arr.length; i++) { | |
callback(i, arr[i]); | |
} | |
}; | |
onload=function() { | |
var test = [ { name : 'a' }, { name : 'b' }, { name : 'c' } ]; | |
each(test, function(index, elem) { | |
alert(index + " = " + elem.name); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment