logo CodeStepByStep logo

eventMystery1

Language/Type: JavaScript events
Author: Melissa Hovik (on 2018/05/21)

For the given JavaScript code, specify the order in which the console.log statements are printed when the program is executed. Your answers should be the single letter corresponding to the 1st, 2nd, or 3rd console.log statement.

console.log("Hello!"); // A

(function() {
    window.onload = function() {
        console.log("Hi!"); // B
    };

    console.log("Hi again!"); // C
})();
        
1.
2.
3.

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.