Double pipe stands for logical "OR". This is not really the case when the "parameter not set", since strictly in the javascript if you have code like this:
function foo(par) {
}
Then calls
foo()
foo("")
foo(null)
foo(undefined)
foo(0)
are not equivalent.
Double pipe (||) will cast the first argument to boolean and if resulting boolean is true - do the assignment otherwise it will assign the right part.
This matters if you check for unset parameter.
Let's say, we have a function setSalary that has one optional parameter. If user does not supply the parameter then the default value of 10 should be used.
if you do the check like this:
function setSalary(dollars) {
salary = dollars || 10
}
This will give unexpected result on call like
setSalary(0)
It will still set the 10 following the flow described above.