use strict in javascript not working for fat arrow?
问题 I found an interesting case where "use strict" is not working as expected in javascript. Following functions "use strict"; var y = () => { console.log(this); } var x = function () { console.log(this); } x(); // undefined due to use strict y(); // window object I think fat arrow context should also be overwritten by undefined, or is my assumption wrong? 回答1: MDN says of arrow functions: Relation with strict mode Given that this is lexical, strict mode rules with regard to this are just ignored