JavaScript Array from() Method
Definition and Usage
The Array.from() method returns an Array object from any object with a length property or an iterable object.
Browser Support
The numbers in the table specify the first browser version that fully supports the method.
Method | |||||
---|---|---|---|---|---|
from() | 45.0 | 12.0 | 32.0 | 9 | 25.0 |
Syntax
Array.from(object, mapFunction, thisValue)
Parameter Values
Parameter | Description |
---|---|
object | Required. The object to convert to an array |
mapFunction | Optional. A map function to call on each item of the array |
thisValue | Optional. A value to use as this when executing the mapFunction |
Technical Details
Return Value: | An Array object |
---|---|
JavaScript Version: | ECMAScript 6 |
Related Pages
JavaScript Tutorial: JavaScript Arrays