$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #156

What is the output?

console.log((0.1 + 0.2).toFixed(2));
  1. 0.30
  2. 0.3
  3. 0.30000000000000004
  4. 0.31
toFixed rounds and returns a STRING, hiding the underlying float drift.
Play Problem Solving ▸