JavaScript - Loops or Iterations in JavaScript