Lesson 9. New array methods
After reading lesson 9, you will
- Know how to construct arrays with Array.from
- Know how to construct arrays with Array.of
- Know how to construct arrays with Array.prototype.fill
- Know how to search in Arrays with Array.prototype.includes
- Know how to search in Arrays with Array.prototype.find
Arrays are probably the most common data structure used in JavaScript. We use them to hold all kinds of data, but sometimes getting the data we want into or out of the array isn’t as easy as it should be. But those tasks just got a lot easier with some of the new array methods that we’ll cover in this lesson.
Consider this snippet of jQuery code that grabs all the DOM nodes with a specific CSS class ...
Get Get Programming with JavaScript Next now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.