Python While Loop Over Array Javascript Push Function In Vector