Python Nested Function Variable Javascript Tutorial