How to use ternary operator in javascript?
by Gabi SolomonThe ternary operator will accept three operands and is used to assign a certain value to a variable based on a condition. The syntax is condition ? result1 : result2;
So if the the condition is evalued as true the result1 is runned else result2.
Example:
[js]
[/js]
This will print out: true
Pretty simple, cheers.
Related Posts
Related Posts
-
http://salzsee.info Salz`
-
http://originalcopy-on.blogspot.com OriginalCopy
-
http://www.jeremywillemse.co.nz/ j87
-
http://www.jdesign.org.uk/ James

