Challenge Hints: Inserting into Arrays

A list of hints for the challenges in the Inserting into Arrays lesson.

Last updated - July 23, 2024

 

Checkpoint

Did you use a variable name and brackets [] with a semicolon at the end?

Remember the order of the parameters .splice(location of item (index), number to delete (1), replacement value)

Try changing the numbers in the parameters for .splice(location of item (index), number to delete (1))

Remember the parameters for .splice(location of item (index), number to delete (0), item to insert)

Name Game

Did you declare an array with the names?

Did you splice the array knowing that the name does not start with J?

Did you splice knowing the name doesn't start with J and that it has only 3 letters?

Did you splice, knowing that it has two of the same letter in a row, doesn't start with a J, and has only 3 letters?

Did you log the name (array) to the console?

Combo Class

Did you declare two arrays for the class names?

Did you combine the two arrays without removing any elements? Did you use the array as the values to add?

Did you log the array to the console?

Fruits and Veggies

Did you declare your lunch array?

Did you add your fruit and vegetable item to the array anywhere without removing anything?

Did you alert the user of the array?

Trip Planner

Did you create an array with the following elements in order: "England", "France", "Italy"?

Did you add two more destinations to your array?

Did you log your array to the console?

Party Playlist Request

Did you declare an array titled "playlist" with at least 10 elements?

Did you get the title for the song from the user?

Did you get the index from the user?

Did you perform the process for 3 songs total?

Did you log the playlist to the console?

For more help with JavaScript, check out our JavaScript Reference Guide!