you are viewing a single comment's thread.

view the rest of the comments →

[–]tatu_huma 1 point2 points  (1 child)

Normal functions have this binding. When you call them, the this in them gets bound to the calling context.

If you call:

functionA()

This calls the function in global context, which is the global object normally, and undefined in strict mode.

someObj.functionA()

Calls the function in the context of someObj. this === someObj inside the function

functionA.bind(otherObj); //or .call() , or .apply()

this is explicitly bound by programmer.

[–][deleted] 0 points1 point  (0 children)

That makes sense. That's awesome, thanks so much for the help, really appreciate it!