Was messing around with some array stuff earlier and discovered a very peculiar caveat
consider this code:
[1,2,3].map(function(el) { return el * 2}).push
Why is the length property being returned here?
It is defined in the specification:
The arguments are appended to the end of the array, in the order in which they appear. The new length of the array is returned as the result of the call.
Why is breaking as is?
Well, you answered this already yourself: .push
returns the new length and .join
is not defined for numbers.