es-shims/Array.prototype.some

Name: Array.prototype.some

Owner: ECMAScript Shims

Description: Array.prototype.some spec-compliant polyfill

Forked from: ljharb/Array.prototype.some

Created: 2016-11-23 15:52:56.0

Updated: 2016-11-23 15:52:57.0

Pushed: 2016-11-23 15:52:48.0

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

Size: 199

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

array.prototype.some Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

An ES5 spec-compliant Array.prototype.some 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.some depends on a receiver (the ?this? value), the main export takes the array to operate on as the first argument.

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

rt.equal(true, some([1, 2, 3], function (x) { return x === 2; }));
rt.equal(false, some([1, 2, 3], function (x) { return x === 4; }));
s
some = require('array.prototype.some');
assert = require('assert');
hen Array#some is not present */
te Array.prototype.some;
shimmedSome = some.shim();
rt.equal(shimmedSome, some.getPolyfill());
arr = [1, 2, 3];
threeOrLarger = function (x) { return x >= 3; };
rt.deepEqual(arr.some(threeOrLarger), some(arr, threeOrLarger));
s
some = require('array.prototype.some');
assert = require('assert');
hen Array#some is present */
shimmedSome = some.shim();
rt.equal(shimmedSome, Array.prototype.some);
rt.deepEqual(arr.some(threeOrLarger), some(arr, threeOrLarger));
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.