Skip to content

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

Notifications You must be signed in to change notification settings

eduardomcv/slice-map

Repository files navigation

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
    // (...)
  }
})

About

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

Resources

Stars

Watchers

Forks