is there way access first argument of call() method of es6 arrow function?
var obj = { getfn: function() { return () => { //how access bar here return this.what; } }, any: 1 } var foo = obj.getfn(); var bar = { any: 2 }; foo.call(bar);
i'm not sure trying do, if asking how access this value passed via .call, answer is: you can't.
since arrow functions don't have own this, there nothing .call set value to. if want function have own this value, don't use arrow function.
Comments
Post a Comment