A function call runs the body at the exact position where the call appears. After the body finishes, execution continues on the following line.
function showMiddle() {
console.log("Middle"); // outputs "Middle"
}
console.log("First"); // outputs "First"
showMiddle();
console.log("Last"); // outputs "Last"Predict the output
A function is declared before any messages are printed. Predict the complete output in order.
function announce() {
console.log("Function");
}
console.log("Before");
announce();
console.log("After");