Arrays and Looping Javascript Source Code