es-shims/Array.prototype.every

Name: Array.prototype.every

Owner: ECMAScript Shims

Description: Array.prototype.every spec-compliant polyfill

Forked from: ljharb/Array.prototype.every

Created: 2016-11-23 01:45:33.0

Updated: 2016-11-23 01:45:34.0

Pushed: 2016-11-23 01:45:21.0

Homepage: https://tc39.github.io/ecma262/#sec-array.prototype.every

Size: 198

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

array.prototype.every Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

An ES5 spec-compliant Array.prototype.every shim/polyfill/replacement that works as far down as ES3.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.

Because Array.prototype.every depends on a receiver (the ?this? value), the main export takes the array to operate on as the first argument.

Example
every = require('array.prototype.every');
assert = require('assert');

rt.equal(true, every([1, 1, 1], function (x) { return x === 1; }));
rt.equal(false, every([1, 0, 1], function (x) { return x === 1; }));
s
every = require('array.prototype.every');
assert = require('assert');
hen Array#every is not present */
te Array.prototype.every;
shimmedEvery = every.shim();
rt.equal(shimmedEvery, every.getPolyfill());
arr = [1, 2, 3];
lessThan4 = function (x) { return x < 4; };
rt.deepEqual(arr.every(lessThan4), every(arr, lessThan4));
s
every = require('array.prototype.every');
assert = require('assert');
hen Array#every is present */
shimmedEvery = every.shim();
rt.equal(shimmedEvery, Array.prototype.every);
rt.deepEqual(arr.every(lessThan4), every(arr, lessThan4));
Tests

Simply clone the repo, npm install, and run npm test


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.