Why is this allowed?
var f = function() { console.log(this.x); }.bind({x:1})();
And why is it not or better, why am I getting a syntax error in this case?
function f() { console.log(this.x); }.bind({x:1})();
So, why do I need the function expression syntax to get this working, and is there a way to use the bind method directly in the function declaration ?
javascript
user3448600
source share