Skip to content

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.

Topics

Resources

Stars

Watchers

Forks