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!