Hacker News new | ask | show | jobs
by _nalply 3005 days ago
Perhaps use the hint parameter of Symbol.toPrimitive() to fix some gotchas like Nothing + 123 => '123'?

See MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Edit: Won't help, because hint == 'number' is only triggered if used with unary plus or minus. Disregard this comment.

1 comments

Nope, hint won't help here as it gets `default` instead of `number`.