Python Modify Array In Function Javascript Practice