Question 7
Back to Exercise
What does the following JavaScript code print (console output, as in Node.js)?
console.log(console.log("Hi"));
- A Hi
- B undefined Hi
- C HiHi
- D Hi undefined Correct
Correct Answer: Option D
The inner call runs first and prints Hi; it returns undefined, which the outer call prints.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!