MDN talks about arrow function :
Strict Mode Communication
Given that this is lexical, strict mode rules regarding this simply ignored.
var f = () => {'use strict'; return this}; f() === window; // or the global object
Lexical this rules take precedence over this strict mode rules.
We can easily see this in the ES2015 specification, studying the same description of the possible values of the [[ThisMode]] slot function , which can be lexical , strict or global :
Defines how this references are interpreted in the formal parameters and function code body. lexical means that this refers to the value of this lexically closing function. strict means that this used exactly as provided by the function call. global means that this undefined interpreted as a reference to a global object.
In other words, the behavior of this can be strict, non-strict, or lexical. If the [[ThisMode]] function is lexical (as for the arrow function), it renders the function a strict / non-strict status inconsequential in order to determine the behavior of this -setting.
source share