A list of hints for the challenges in the If Statement Conditions lesson..
Last updated - July 23, 2024
Checkpoint |
Make sure to include "var" before coins Are you using the right comparisons in order? ">=", "&&", and "==" |
Buy Two, Get One Free |
Did you prompt the user asking if they bought either 1 or 2 items? Did you properly declare your function to accept a parameter and check the conditionals? Are you missing alerts? Did you repeat the prompt and call process at least 3 times? |
Allergy Checker |
Did you prompt the user for each of the three allergens? Did you check to see if they were not allergic and alert them to enjoy something for each variable? Did you alert them to enjoy something else otherwise? |
Go Fish |
Did you prompt the user asking for the animal card they are looking for? Did you prompt the player asking if they have that card? Did you alert them to "Go Fish!" if the response did NOT equal true? (Hint: you must use does not equal as the conditional in your if) Did you alert them "You got a match!" otherwise? |
Golf Scores |
Did you prompt the user for the three variables? Did you alert the rewarding message if the conditionals were met? Did you alert "Congratulations" if the conditionals were met? Did you alert them wishing them luck next time? |
The Cash Register |
Did you prompt the user for the cost of the item they are purchasing? Did you prompt the user for the number of dollars they are paying with? Did you alert the user if they are paying with less dollars than the cost of the item? Else, if they paid with the exact amount did you alert them they paid with exact change? Did you alert them of their change? |
For more help with JavaScript, check out our JavaScript Reference Guide!