For Loop Using Range Function In Javascript