-
Notifications
You must be signed in to change notification settings - Fork 1
Javascript
HOA PHAN edited this page Mar 16, 2024
·
5 revisions
- Browsers
- Nodejs: https://nodejs.org/en
- V8: https://v8.dev/blog
https://dev.to/lydiahallie/javascript-visualized-event-loop-3dif
The absolute subzero IQ design:
const module = {
x: 42,
getX: function () {
return this.x;
},
};
const unboundGetX = module.getX;
console.log(unboundGetX()); // The function gets invoked at the global scope
// Expected output: undefined
const boundGetX = unboundGetX.bind(module);
console.log(boundGetX());
// Expected output: 42