Codington
0 of 8 problems solved • 0%

Exercise prompt

Predict Function Order

A function call runs the body at the exact position where the call appears. After the body finishes, execution continues on the following line.

Example

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");
What will this code print?