Search⌘ K

Array Improvements

Explore ES6 array improvements to transform array-like objects using Array.from and create arrays with Array.of. Understand how to find elements using Array.find and findIndex, and learn how some and every check conditions within arrays to streamline your JavaScript code.

Array.from() #

Array.from() is the first of many new array methods that ES6 introduced.

It will take something arrayish- meaning something that looks like an array but isn’t- and transform it into a real array.

Look at the code in the JavaScript and the HTML tab to see what is happening.

We can also simplify like this:

Now we transformed fruits into a real array, meaning that we can use any ...