Writing Javascript in a more "pythonic" manner.