Created a For Loop in JavaScript