You are reading a single comment by @asez73 and its replies.
Click here to read the full conversation.
-
Yes, you are right.
After reading this tutorial, I still have to correctly understand the real closure/implicit or explicit definition(s) of this: This is a beginner's problem in Javascript any way.
The tutorial seems to be slightly out of date, on the other hand I nearly understood the difference between binding and late binding.
Still have to experiment that anyway.
'this' represents the default runtime context from within a function is invoked - event or otherwise. If the function is bound though to an object before invocation with
.bind(contextObject)
,this
in the function will refere to the boundcontextObject
and - according to @Gordon - it is even faster then an anonymous function. On the other hand, binding takes away the freedom to use the function on/in/for different contexts (objects). Im talking about simple invocation because.apply()
and.call()
can help to keep the flexibility and provide different ways to pass the arguments: as array or individually, respectively. All these language elements/constructs help with (meta) data driven code / logic / algorithms.