Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
unstable
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
unstable
2y ago
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 writing code. Bt
2.
▲
by
unstable
2y ago
> 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 === "nu
3.
▲
by
unstable
2y ago
> 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 should be
4.
▲
by
unstable
2y ago
Thanks for the links, awesome!