How to use this in arrow function with JavaScript

1 Answer

0 votes
var globalObject = this;

var f = (() => this);

console.log(f() === globalObject); 




/*
run:

true

*/

 



answered Nov 20, 2020 by avibootz

Related questions

...