Challenge Hints: For Loops

A list of hints for the challenges in the For Loops lesson.

Last updated - June 30, 2023

 

Space Launch

Did you use the word "function" before your function?

Did you use the word "var" before your variable name?

Do you decrement each time the for loop runs?

Use the "+" symbol to concatenate LIFTOFF at the end.

Class Scheduler

Did you prompt the user for how many classes they are taking?

For each period, did you get the class title and then add it to an array?

Lunchtime

Did you prompt the user for the number of people eating lunch?

For each person, did you ask if they are buying or packing a lunch?

If they packed a lunch/ are not ordering, did you alert them to get a seat?

Otherwise, did you tell them to order food and increment the count of students ordering?

Did you alert the final total of students ordering food?  

Pizza Party

Did you prompt the user for the number of students attending the pizza party?

For each student attending the party, did you ask if they would like a pepperoni or cheese pizza?

If they wanted a pepperoni pizza, did you increment the pepperoni count?

Otherwise, did you increment the number of cheese pizzas?

alert(   )

Savings Calculator

Did you prompt the user for how much money they are wanting to save?

For each month in the year, did you get 10% of the current savings and update the amount?

Did you alert the user of the total savings once the year had been completed?

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