While Loop Structure Javascript Array Methods