Challenge Hints: Adding to Arrays

A list of hints for the challenges in the Adding to Arrays lesson..

Last updated - July 23, 2024

 

Checkpoint

An array uses these brackets [  ] 

Make sure the name of your array matches the one that you are pushing to.

Do you have a console log in your file?

Zoo Trip

Did you declare the array "zoo" as empty?

Did you use a single line to push all 5 animals to your array?

console.log( )

Get to Know You

Did you declare an empty array?

Did you prompt the user with 7 questions to get to know them?

Did you push each response to the array immediately after?

Did you log the array to the console?

Birthday Wishes

Did you declare an empty array called wishes?

Did you alert the user that they get 5 wishes?

Did you get each wish from the user and immediately add it to the array?

Did you log the array to the console?

Book List

Did you declare an empty array?

Did you push a planner to the array?

Did you ask the student which grade they are in?

Did you add "intro. math", "envi. science", and "writing principles" to your array if they are in 6th grade?

If they are in 7th grade, did you push "inter. math", "biology", and "intro. lit" to the array?

Otherwise, did you push "adv. math", "chemistry", and "adv. lit" for the 8th graders?

console.log()

Homework Checker

Did you declare an empty array titled "homework"?

Did you prompt the user if they had homework in english, math, science, and history? (each class should be its own question)

If they said yes, did you get the name of their homework and push it to the array?

Did you do nothing if they do not have homework?

Did you log the array to the console?

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