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:
So pretty much I would like to write:
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.