logo CodeStepByStep logo

functionMystery3

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();
    first();
    console.log("Done with main.");
}

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

function second() {
    console.log("Inside second function.");
    third();
    console.log("Done with second function.");
}
    
function third() {
    console.log("Inside third 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.