Python Change Array Value Javascript Function Definition