From the course: JavaScript Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Array methods

Array methods - JavaScript Tutorial

From the course: JavaScript Essential Training

Start my 1-month free trial

Array methods

- [Instructor] Arrays are used a lot in JavaScript. So there's a whole array of array methods to do things with arrays and their contents. All of these methods are heavily documented with examples in the MDN web docs. You can find them under static methods and instance methods. And this whole page is well-worth a read once you're finished with the course. In the meantime, let's look at some of these methods in more detail. In the exercise files for this movie, I've set up a basic array called backpackContents. It contains three items: piggy, headlamp, and pen, and when we output it, you see them over here in the browser. All right. So far, nothing new. A very common thing we want to do with an array is just output all of these values in the array as a string. This can be done using the join method and the join method is added directly to the object itself. So I'll just say .join, and then call it as a method by…

Contents