Results 1 to 4 of 4
Jul 2, 2007, 19:17 #1
- Join Date
- Oct 2004
- 0 Post(s)
- 0 Thread(s)
Using Ternary operators instead of if statement, is it possible?
I would appreciate all the help. I would like to write a function which would take couple of parms such name and address. Can I use ternary operators instead of IF STATEMENT to validate the function arguments:
document.write("Name: " + name + "<br>");
var name = (name == ' ') ? 'name' : ' ';
I am not sure if this is the write syntax. Appreciate all the help.
Thanks a lot.