mapConsecutive
Maps each block of n
consencutive elements using the given function, fn
.
- Use
Array.prototype.slice()
to getarr
withn
elements removed from the left. - Use
Array.prototype.map()
andArray.prototype.slice()
to applyfn
to each block ofn
consecutive elements inarr
.