Do you know what will be the output of this code?
JavaScript
const getX = () => this.x;
console.log(getX.call({ x: 1 }));
Show answer and explanation
The answer is undefined.
Arrow functions don’t have their own this, so call can’t set one. The first argument is ignored and this comes from the surrounding scope, which has no x.