I struggled to wrap my head around these two new operators, the && and the ||.
So I decided to write a post about them to explain them to myself.
var || 'hi' will return 'hi' when false
var && 'hi' will return 'hi' when true
So:
var || 'hi' means:
return 'hi' if var is false
--or--
var ? var : 'hi'
and:
var && 'hi' means:
return 'hi' when var is true
--or--
var ? 'hi' : var
Subscribe to:
Post Comments (Atom)
-
I've been struggling for two days with this and finally found the solution. Scroll down for that. Background : So my UART2 plug b...
-
I have learnt a few things in the last few months of flying and I would like to share it with the world. There's no use struggling when ...
-
Just an update: Here's my attempt(still needs a lot of texturing work) at remaking Alpha crater. Hardwar has a game mode where you ...
No comments:
Post a Comment