Python Change Array Value Javascript Function Syntax