Q. What does the following code output?

Code:
console.log(0.1 + 0.2 === 0.3);
  • (A) true
  • (B) false
  • (C) undefined
  • (D) NaN
πŸ’¬ Discuss
βœ… Correct Answer: (B) false
Explanation: Due to floating-point precision issues in JavaScript, `0.1 + 0.2` does not exactly equal `0.3`, so the comparison returns `false`.
Explanation by: Mr. Dubey
Due to floating-point precision issues in JavaScript, `0.1 + 0.2` does not exactly equal `0.3`, so the comparison returns `false`.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
67
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
98%
Success Rate