So first of all the ['a','b','c']
is a distraction. You would get the same overal resul with const something = [].map.bind([1,2,3]);
. That first part of the code is just there to get a reference to the map method of an array. The same could be obtained with Array.prototype.map
, but [].map
takes less typing.
The bind is binding this map function to the array [1,2,3]
, and that is what something
is pointing to, a version of the map function bound to [1,2,3]
. For example if you called something(v=>v*2)
you would get back [2,4,6]
.
Check out the MDN pages for Array, Array~map, Function and Function~bind for more info.