Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Array.from()

2 tags 1 category

The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.

iterable objects (objects such as Map and Set); or, if the object is not iterable, array-like objects (objects with a length property and indexed elements).

To convert an ordinary object that’s not iterable or array-like to an array (by enumerating its property keys, values, or both), use Object.keys(), Object.values(), or Object.entries(). To convert an async iterable to an array, use Array.fromAsync().

Array.from() never creates a sparse array. If the items object is missing some index properties, they become undefined in the new array.

Syntax example: Array.from(items)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…