Looking for some assistance with the quiz below.
/*
* Challenge: Ice Cream Order (3-6)
*
* Create a single if statement to output the message:
*
* "I'd like two scoops of __________ ice cream in a __________ with __________."
*
* ...only under these conditions:
* - flavor is "vanilla" or "chocolate"
* - vessel is "cone" or "bowl"
* - toppings is "sprinkles" or "peanuts"
*
* This test focuses on the if statement and boolean operators.
* The exact output string doesn't have to match.
*/
// Adjust the values of `flavor`, `vessel`, and `toppings` to test your code
var flavor = "strawberry";
var vessel = "hand";
var toppings = "cookies";
// Insert your code here
if ((flavor === "vanilla" || flavor === "chocolate") && (vessel === "cone" || vessel === "bowl") && (toppings === "sprinkles" || toppings === "peanuts")) {
console.log("I'd like two scoops of " + flavor + " ice cream in a " + vessel + " with " + toppings + ".");
}
else {
}
I'm struggling to figure out how to display the statement only when the specified conditions are met. When I use undefined variables, they still show in the console log. I'm hoping to avoid that. I hope this explanation makes sense. Any guidance would be highly appreciated. Thank you!