JavaScript Array.from()
JavaScript Array.from()
The Array.from() method is used to return an array from any object with a length property. It returns an array from any iterable object. It is a static property and is only used by the Array.from() method.
Syntax:-
Its syntax is:- Array.from(object, mapFunction, thisValue)
Return:-
Its return is:- an array from any iterable object.
Further Explanation:-
Parameter | Description |
object | Required. The object to convert to an array. |
mapFunction | Optional. A map function to call on each item. |
thisValue | Optional. A value to use as this for the mapFunction |