Hello,

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:

PHP Code:
function(name)
{
  if(!
name)
  {
  
document.write("Name: <br>");
  }
  else
  {
  
document.write("Name: " name "<br>");
  }


So pretty much I would like to write:

var name = (name == ' ') ? 'name' : ' ';

I am not sure if this is the write syntax. Appreciate all the help.

Thanks a lot.