|
|
|
|
|
by jQueryIsAwesome
4913 days ago
|
|
In what other language you have direct access to methods as first class objects to do an immediate execution of a method returned by an execution container (parenthesis in JS) ? I think most people would write it like this: playing ? player.play() : player.pause()
|
|
Not sure if i understand the question. This seems to work in Python:
Not that it's a very pythonic piece of code, but it works, and i would expect many other languages support something similar.Anyway, that's tangential. And i wasn't discussion what "most people would" do either. What i was trying to say is that by aliasing "var self = this" you're not automatically immune to the quirks of "this" in JS.