Guest practice: this set is not saved and does not count.
Which one is a parameter?
function add(a, b) { return a + b; } let sum = add(2, 3);
b
add(2, 3)
sum
2
A function definition must end with a semicolon after the closing }, or JavaScript gives an error.
}
btn.addEventListener("click", showMenu()); runs showMenu once when the page loads, not when the button is clicked.
btn.addEventListener("click", showMenu());
showMenu
What does this log?
function check(n) { if (n > 3) { return "big"; } console.log("not big"); return "small"; } console.log(check(5));
big
small
not big
A function that never reaches a return statement gives back undefined.
return
undefined
Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.
Check my answers