Array.from

Creates an array from an array-like or iterable object.

Syntax

from(arrayLike, mapfn?, thisArg?)

Parameters

Examples

Array.from(new Uint8Array([1, 2, 3]))
[ 1, 2, 3 ]
Array.from(new Set([1, 2, 3]), x => 2**x)
[ 2, 4, 8 ]