Easy question. Does exist something like php's ??
in javascript?
In php you can do condition ?? statement2
which is the same as condition? condition : statement2
.
Is there something like that in javascript?
Easy question. Does exist something like php's ??
in javascript?
In php you can do condition ?? statement2
which is the same as condition? condition : statement2
.
Is there something like that in javascript?
So, if condition is false, go with statement2.
That's as simple as condition || statement2
If condition is truthy, if will be selected. If not, statement2 will be evaluated.