JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 102
  • Score
    100M100P100Q63636F
  • License MIT

Optimized Array Utility Library

Package Exports

  • nor-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nor-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

nor-array

Optimized Array Utility Library

Installation

Install using NPM: npm install nor-array

Example Usage

var ARR = require('nor-array');

var a = [1, 2, 3, 4];

ARR(a).forEach(function(v) {
    console.log(v);
});

Our implementation is about 50% faster than the standard Array.prototype.forEach().

Compatibility with standard Array methods

Our implementations are not fully compatible with ECMAScript implementations of Array operations.

Most notably because our implementation expects:

  • Array is a dense (NOT sparse -- there must be no holes!)
  • Assumes that indexes are between zero (0) and array.length: 0 <= i < array.length
  • Does not support thisArg, call o.callback.bind(o) instead
  • The array indexes do not change while our .forEach() is running

This assumption is the reason why it is faster.

Function Reference

Sample usage Description
ARRAY(a).valueOf() Returns the original array
ARRAY(a).forEach(..) See Array.prototype.forEach()
ARRAY(a).map(..) See Array.prototype.map()
ARRAY(a).filter(..) See Array.prototype.filter()
ARRAY(a).find(..) See Array.prototype.find()
ARRAY(a).findIndex(..) See Array.prototype.findIndex()
ARRAY(a).every(..) See Array.prototype.every()
ARRAY(a).some(..) See Array.prototype.some()
ARRAY(a).concat(..) See Array.prototype.concat()
ARRAY(a).indexOf(..) See Array.prototype.indexOf()
ARRAY(a).lastIndexOf(..) See Array.prototype.lastIndexOf()
ARRAY(a).join(..) See Array.prototype.join()
ARRAY(a).reduce(..) See Array.prototype.reduce()

License

The MIT style license, see LICENSE.

Commercial Support

You can buy commercial support from Sendanor.