by neutronicus · 15y ago · 0 comments
This idiom is baked into the perl community. It's kind of funny to see a Pythonista deciding it's a good idea. (You can tell it hurts him too).
$foo // "default"
evaluates to "default" if $foo is undefined, and to $foo otherwise (even if it is defined but false). stuff = stuff||[]
since JavaScript doesn't even support default argument values.