5 ms·
'obviously'? The code looks fine to me, c.f.: $ node > undefined || undefined || 4 4 > undefined || 9 || 4 9 The || operator evaluates to
by sago 10y ago
'obviously'?
The code looks fine to me, c.f.:
$ node
> undefined || undefined || 4
4
> undefined || 9 || 4
9
The || operator evaluates to the first of its two operands if it is truthy, or its second operand otherwise
> undefined || false
false
> false || undefined
undefined
So:
> e = {keyCode:9}
> e.which || e.charCode || e.keyCode
9