Python Change Array Value Javascript Function