logo CodeStepByStep logo

printProgram

Language/Type: JavaScript basics println

Write a JavaScript function named printProgram whose output is the text that would be the source code of a JavaScript function named hello that prints "Hello, world!" as its output:

function hello() {
    console.log("Hello, world!");
}

Your program must produce exactly the output shown in order to pass (using exactly four spaces for each increment of indentation in the output).

Function: Write a JavaScript function as described, not a complete program.

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.