Recursive Array.flat

There was much talk about Array.prototype.flat during its early stages, starting with the name alone. Many developers preferred the name flatten but the spec differed from MooTools’ implementation. MooTools would recursively flatten an array but the new, official flat implementation defaults one level of flattening,. The current implementation of Array.prototype.flat is: [1, 2, [3], [[4]]].flat(/* […]

The post Recursive Array.flat appeared first on David Walsh Blog.