Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
debaserab2
· 9y ago · 0 comments
this.setState({ isConnected: !!weAreConnected })
Comments
[–]
hypervis0r
9y ago
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
9y ago
Ding ding ding right answer. This is the way most senior javascript devs would right it.
[–]
corn13read
9y ago
They'd right it if they were fixing it or write it if they were writing it ;)