LearnFrenzy
Sign in Take a free test

JavaScript Basics · Predict the Output · Question 11

Names that differ only in case Answer, explanation & discussion

  • Output
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 11 Back to Exercise

What does the following JavaScript code print (console output, as in Node.js)?

main.js
let total = 10;
let Total = 20;
let TOTAL = total + Total;
console.log(total, Total, TOTAL);
  • A 10 20 30 Correct
  • B 20 20 40
  • C SyntaxError: total has already been declared
  • D 30 30 30
Correct Answer: Option A

Identifiers are case-sensitive, so total, Total and TOTAL are three separate variables.

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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links