HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by debaserab2 | Hacker News Reader
Parent
Full thread
debaserab2
·
this.setState({ isConnected: !!weAreConnected })
View on HN
hypervis0r
·
This^, plus, you shouldn't really have "null" or "undefined" variables which you treat as bool (if you do, then that's a bug)
DeonPenny
·
Ding ding ding right answer. This is the way most senior javascript devs would right it.
corn13read
·
They'd right it if they were fixing it or write it if they were writing it ;)
Reply on news.ycombinator.com