What does this candidate print for an input whose unit suffix should be rejected?

from Code provenance and verification
Node 24 intermediate 3 min

What does this candidate print for an input whose unit suffix should be rejected?

JavaScript
function timeoutMs(value) {
  const seconds = Number.parseInt(value, 10);
  if (!Number.isFinite(seconds) || seconds < 0) {
    throw new TypeError("invalid timeout");
  }
  return seconds * 1_000;
}

console.log(timeoutMs("5s"));
Open in playground
Report an error