In default 'if' one line statement are two block, for true, and false:
variable ? true block : false block;
How declare 'if' with one block?
I expect something like this:
variable ? true block;
if(variable) block;
With the conditional operator you need the false bit also.
You can do:
variable && block
For example:
let variable = true;
let o = variable && 3;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With