mapConsecutive
Maps each block of n consencutive elements using the given function, fn.
- Use
Array.prototype.slice()to getarrwithnelements removed from the left. - Use
Array.prototype.map()andArray.prototype.slice()to applyfnto each block ofnconsecutive elements inarr.