3 ms·
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/J
by _nalply 9y 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/Reference/Global_Objects/Symbol/toPrimitive 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.
- slmgc 9y agoNope, hint won't help here as it gets `default` instead of `number`.