Question 9
Back to Exercise
What does the following JavaScript code print (console output, as in Node.js)?
console.log('It\'s', "a \"quote\"", `and ${'more'}`);
- A It\'s a \"quote\" and more
- B It's a quote and more
- C It's a "quote" and more Correct
- D It's a "quote" and ${'more'}
Correct Answer: Option C
A backslash escapes the quote inside a string of the same kind; the backslash itself is not printed. The template literal evaluates ${'more'}.
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!