From the course: JavaScript Essential Training

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Challenge intro: Array manipulation

Challenge intro: Array manipulation - JavaScript Tutorial

From the course: JavaScript Essential Training

Challenge intro: Array manipulation

(upbeat music) - [Instructor] Arrays are used all the time in JavaScript and having a good handle on array manipulation gives you the capability to make arrays work for you. In this challenge, you're given an array called desk array that has a bunch of items. Your task is to use a sequence of array manipulations to change the contents of this existing array in a very specific order. I want you to first remove the last item from the array. Next, sort the remaining array items alphabetically, then move the last item of the array to the first position. Then find the USB drive item in the array and move it to the last position. And finally, find the laptop item in the array and remove it from the array. Yes, that's a lot. So if you go to the instructions, you can see the list here of what you need to do, and it's important that you do these things in order because otherwise you'll end up with an array that is structured the…

Contents