Javascript foreach equivalent

var arr = ['uno', 'due', 'tre'];
for (var i in arr) {
       alert(arr[i]);
}

var is very important, otherwise you’ll get an error in IE.

This entry was posted in Javascript and tagged , . Bookmark the permalink.

Leave a Reply