LearnFrenzy
Sign in Take a free test

Operators · JavaScript Operators MCQ · Question 1

== vs === Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 1 Back to Exercise

What is the difference between == and ===?

  • A === compares value and type without conversion; == converts the operands to a common type first Correct
  • B == compares references and === compares values
  • C === is faster but gives the same results as ==
  • D == works only with numbers
Correct Answer: Option A

5 == "5" is true because the string is converted; 5 === "5" is false because the types differ.

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