var length = arr.length;
element = null;
for (var i = 0; i < length; i++) {
element = arr[i];
// Do something with element i.
}
new_array.push(element);
object loop through
for (var property in object) {
if (object.hasOwnProperty(property)) {
// do stuff
}
}
No comments:
Post a Comment