I know this is silly, but as a little joke based on a conversation with family, I made this:
var hungerLevel;
var breakTime;
function shouldIEat(hungerLevel, breakTime) {
if (hungerLevel > 5 || breakTime > 90) {
alert("Eat!");
} else {
alert("Do not eat.");
}
}
If I were to actually create a web page with inputs for Hunger Level and Length of break, how would I attach the function to the inputs? Is this something I can figure out before finishing the Basic Javascript challenges? And could I do this on Codepen? Or do I need to use some sort of hosting so that the data actually gets collected?