Accepting NaN as a number can potentially crash your app, that's why I reject it in isNumber. I only tried to highlight some edge cases that I personally don't like to spend energy on, trying to get it right, when…
> You can write isNumber(foo) instead of typeof foo === "number". Indeed you can, but it depends what isNumber does. This is more like what it should do IMO: function isNumber( foo ) { return ( (typeof foo === "number")…
> while the whole thing should be on the editor's side. This. I'd prefer using my own preferences instead of using a dumb formatter like prettier. Who cares some other dev in your team prefers 2 chars indentation? It…
Thanks for the links, awesome!
Accepting NaN as a number can potentially crash your app, that's why I reject it in isNumber. I only tried to highlight some edge cases that I personally don't like to spend energy on, trying to get it right, when…
> You can write isNumber(foo) instead of typeof foo === "number". Indeed you can, but it depends what isNumber does. This is more like what it should do IMO: function isNumber( foo ) { return ( (typeof foo === "number")…
> while the whole thing should be on the editor's side. This. I'd prefer using my own preferences instead of using a dumb formatter like prettier. Who cares some other dev in your team prefers 2 chars indentation? It…
Thanks for the links, awesome!