If I define this in PS:

  (defun test-opt (&optional x)
      (return (if x "yes" "no")))

then I get the following in the browser:

  testOpt(123)
    => "no"

Daniel