Spot the bug in the environment parser

from Data types
Node 24 beginner 4 min 2 issues to find

Find why this generated environment parser changes valid false and zero values.

JavaScript
function readWorkerOptions(env) {
  return {
    debug: Boolean(env.DEBUG),
    retries: Number(env.RETRIES || 3),
  };
}

console.log(readWorkerOptions({ DEBUG: "false", RETRIES: "0" }));
Open in playground
Report an error