T
töff
Usually I write something like ...
if (x==1) { doSomething() }
.... and that's how I see it in all the JS references I've found so
far.
But I have seen shorthand (?) for the same thing (?), like this ...
(x==1) ? doSomething()
.... and several other "alternate" methods.
Are they documented somewhere? I kinda like them, but are they
supported in the usual gang of browsers? or is it stupid to use them
because they are fringe/sloppy?
Thnx in advance
if (x==1) { doSomething() }
.... and that's how I see it in all the JS references I've found so
far.
But I have seen shorthand (?) for the same thing (?), like this ...
(x==1) ? doSomething()
.... and several other "alternate" methods.
Are they documented somewhere? I kinda like them, but are they
supported in the usual gang of browsers? or is it stupid to use them
because they are fringe/sloppy?
Thnx in advance