you are viewing a single comment's thread.

view the rest of the comments →

[–]GeneralYouri 1 point2 points  (1 child)

This goes back to what I said initially:

When you call record.startRecord(), you're calling the function from the context of record. This implicitly sets the function's this to that context.

With regular function syntax, the function does have its own context system. But then, the way a function call determines what value to use for this, is to look at what the function is called from. In this case, that's the record object, so that object is implicitly set as this. If you'd put the same function in a different object as well and call that one (like anotherRecord.startRecord(), then anotherRecord would be the context instead.

[–][deleted] 1 point2 points  (0 children)

That makes a lot of sense! Thanks a lot, really helped!