Added iterating arrays in JavaScript