A freestanding JavaScript function that uses this is easily mistaken for a constructor (devblogs.microsoft.com)
from tedu to programming on 08 Sep 2023 07:12
https://azorius.net/g/programming/p/gfx6Hkz7sChZ9xYFtx-A-freestanding-JavaScript-function-that-uses-thi

You can override the normal assignment of this by using methods like call, apply, or bind. The call and apply methods override the value of this for a single call of that function. The bind method returns a new function that calls the original function with the this overridden by the value you specify at bind time.

#javascript #programming

threaded - newest