What will the console.log(0.1 + 0.2 === 0.3) statement output?
a)
trueb)
falsec)
undefinedd)
NaNAnswer:
b)
falseExplanation:
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.