Set a value to a variable if one doesn't exist, like this:
name = name || 'joe';
This is quite common and very helpful. Another option is to do:
name || (name = 'joe');
Set a value to a variable if one doesn't exist, like this:
name = name || 'joe';
This is quite common and very helpful. Another option is to do:
name || (name = 'joe');