Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Lesson 11 level 8 Helper Functions

function scanAndPay(item, amount)
{
console.log("Welcome to scan and pay service");
console.log(`Payment of ${amount} done for purchasing ${item}.`);
}

function orderFood(item)
{
switch(item)
{
case "Burger":
scanAndPay(item, 50); //
break;
case "Cold Drink":
scanAndPay(item, 30); //
break;
case "Pizza":
scanAndPay(item, 100); //
break;
}
}


error showing that "Complete the case for ordering a burger."
Please someone help me in this.
by

2 Answers

kshitijrana14
Try this one

<!doctype html>
<html>
<head>
<title>Using External JS Library</title>
</head>
<body>
<div id="myDiv">Hello Studytonight!</div>
<script src="use jquery cdn"></script>
<script >
// change text of div
$("#myDiv").text("Welcome to Studytonight!");
</script>
</body>

</html>
kshitijrana14
Try in second tab this code

let mobiles = ["Apple", "Samsung", "One Plus", "Moto", "Huwaei"];

// using forEach function
mobiles.forEach(printMobs);

// define the callback function
function printMobs(item,index) {
console.log(`Rank ${index}: ${item} Mobiles`);
}

Login / Signup to Answer the Question.