Skip to content

A robust & optimized ES3-compatible polyfill for the `Array.of` method in ECMAScript 6.

License

Notifications You must be signed in to change notification settings

es-shims/Array.of

 
 

Repository files navigation

array.of Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

An ES2015 spec-compliant Array.of shim. Invoke its "shim" method to shim Array.of if it is unavailable or noncompliant.

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

Most common usage:

var assert = require('assert');
var arrayOf = require('array.of');

assert.deepEqual(arrayOf(1, 2, 3), [1, 2, 3]);

if (!Array.of) {
	arrayOf.shim();
}

assert.deepEqual(Array.of(1, 2, 3), [1, 2, 3]);

Tests

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

Author

twitter/mathias
Mathias Bynens

About

A robust & optimized ES3-compatible polyfill for the `Array.of` method in ECMAScript 6.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%