Python While Loop Over Array Javascript Gfg