Array Improvements

This lesson covers the new methods to create and handle Array in ES6.

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.

Console

We can also simplify like this:

Console

Now we transformed fruits into a real array, ...

Access this course and 1400+ top-rated courses and projects.