This question might already be asked.
From the documentation, we can pass a thisVariable
to a map function.
var foo=[1,2].map(function(){return this.length},[2,4]); // [2,2]
This syntax in ES6, however, returns something else
var foo=[1,2].map(_ => this.length ,[2,4]); // [0,0]
What is the [0,0]
returned?