1. array-from
A ponyfill for the ES 2015 (ES6) `Array.from()`.
array-from
Package: array-from
Created by: studio-b12
Last modified: Mon, 13 Jun 2022 03:28:17 GMT
Version: 2.1.1
License: MIT
Downloads: 6,174,169
Repository: https://github.com/studio-b12/array-from

Install

npm install array-from
yarn add array-from

Coveralls – test coverage
Travis – build status
David – status of dependencies
Code style: airbnb

array-from

A ponyfill for the ES 2015 Array.from().

* Ponyfill: A polyfill that doesn't overwrite the native method.
* ES 2015: The new name for ES6 that nobody expected.

Modeled after the final ES 2015 spec. Credits for the implementation go to the amazing folks of the MDN and the amazing guy @barberboy.

 

Installation

 $ npm install array-from

Usage

Recommended:

 var arrayFrom = require('array-from');
  // You’ll get the native `Array.from` if it’s available.

function () {console.log(
  arrayFrom(arguments).map(require('1-liners/increment'))
);}(1, 2, 3);
//» [2, 3, 4]

You can also use it as a classical polyfill. It’s not recommended, but sometimes practical:

 if (!Array.from) Array.from = require('array-from');
  // This will affect all loaded modules.

function () {console.log(
  Array.from(arguments).map(require('1-liners/increment'))
);}(1, 2, 3);
//» [2, 3, 4]

Support note

We support the current and active LTS release of Node.js. More info in nodejs/LTS.

License

MIT © Studio B12 GmbH

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin