Below code demonstrates the usage of foreach:
var Arr1 = [1,2,3,4,5];
Arr1.forEach(function(d,i){
console.log(Arr1[i]);
});
Try it at: http://jsbin.com
Refer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
var Arr1 = [1,2,3,4,5];
Arr1.forEach(function(d,i){
console.log(Arr1[i]);
});
Try it at: http://jsbin.com
Refer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
No comments:
Post a Comment