let cheese = "Cheddar";
if (cheese) {
console.log("Yay! Cheese available for making cheese on toast.");
} else {
console.log("No cheese on toast for you today.");
}
Can anyone help me out with this ?
I know the answer ("“Yay! Cheese available for making cheese on toast”)but can’t get it how ?
your variable cheese has value of a string, which is a truthy value so when put in the conditional it behaves like the boolean true, and your if content executes