0.2.0 • Published 4 years ago
array-lite v0.2.0
ArrayLite
Tiny array utility inspired from the builtin Array and Set methods which does not access the global object.
This module was developped to produce code resilient to modification of the global object.
It provides a significantly faster alternative to performing Reflect.apply on Array.prototype's methods.
Array.prototpeconcateveryfilterfindfindIndexflatflatMapforEachincludesindexOfjoinlastIndexOfmapreducereduceRightreverseslicesome
Set.prototypehasadddelete
- Specific to
array-lite:mapReduce
These functions are not intended to work exactly as their builtin counterpart. Main differences are:
- The array is passed as the first argument rather than the
thisargument. - Arguments are assumed to be present and of the correct type (i.e.: no type checking nor casting).
- It is not possible to specify the
thisargument passed to callback functions (e.g.:forEach,map,filter, etc).