Skip to content

Latest commit

 

History

History
12 lines (12 loc) · 415 Bytes

README.md

File metadata and controls

12 lines (12 loc) · 415 Bytes

An implementation of slice + map done in a single iteration.

Usage

const newArray = sliceMap({
  array,                    // the array to iterate over
  start: 1,                 // index where to start the slice (inclusive)
  end: 3,                   // index where to end the slice (non-inclusive)
  map(item, index, array) { // the mapping function applied to each array item
    // (...)
  }
})