You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
679 B
JavaScript
28 lines
679 B
JavaScript
var price = 1000;
|
|
|
|
/*
|
|
if (price > 100) { //true or false ---- Booloen
|
|
console.log ("You have 10% dicount for this item ");
|
|
console.log ("log again");
|
|
}
|
|
if (price === 100) { //note the operator!
|
|
console.log ("You have 8% discunt for this item");
|
|
}
|
|
if (price === 50) { //note the operator!
|
|
console.log ("Purchase for 100 or more to get discount")
|
|
}
|
|
*/
|
|
|
|
|
|
|
|
if (price > 100) {
|
|
console.log ("You have 10% dicount for this item ");
|
|
} else if (price === 100) {
|
|
console.log ("You have 8% discunt for this item");
|
|
} else if (price === 50) {
|
|
console.log ("Purchase for 100 or more to get discount");
|
|
} else {
|
|
console.log("invalid data");
|
|
}
|
|
|
|
|