What will the console.log(0.1 + 0.2 === 0.3) statement output?
a)
true
b)
false
c)
undefined
d)
NaN
Answer:
b)
false
Explanation:
In JavaScript, the expression 0.1 + 0.2 === 0.3
evaluates to false
due to floating-point precision issues. JavaScript uses floating-point arithmetic, which cannot precisely represent some decimal numbers, leading to small errors in calculations.