Im learning JS and trying to do a Diner Menu using “prompt” and “alert”, but I get stuck on having the values and the total aswell.. please help. here is my code :
const menu = {
"hotdog": 1.00,
"hamburger" : 3.00,
"lasagna" : 4.00,
"chilli_cheese_fries" : 3.00,
"soda" : 3.00,
"popcorn" : 2.00,
"salad" : 6.00
}
console.log(menu);
const menu_1 = Object.keys(menu)
var name = prompt("Hello what's your name?");
var saludo = prompt("Hello " + this.name + "!" + " What would you like to order?") // 'hotdog' = 1
var side = ("Please select a side") // hamburger = 3
const total = (this.menu_1[this.saludo] + this.menu_1[this.side])
// var saludo_1 = "salad"
// var please = ("please enter your name")
alert(this.total)
const bill = prompt(`Your bill is ${total}`)
console.log(total);
