Python Nested Function Variable In Javascript