logo CodeStepByStep logo

functionMystery2

Language/Type: JavaScript basics functions reference semantics
Author: Melissa Hovik (on 2016/09/25)

Assume the following functions are defined:

function main() {
    first();
    second();
    third();
    second();
    console.log("Done with main.");
}

function first() {
    console.log("Inside first function.");
}

function second() {
    console.log("Inside second function.");
    third();
    console.log("Done with second function.");
}
    
function third() {
    console.log("Inside third function.");
    first();
    console.log("Called first function.");
    console.log("Done with third function.");
}

What console output would result from calling main?

output

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.