3 ms·
I'm a little confused; what's going on in the part of the main if condition after the &&? It looks like the author intended to check if any of e.which, e.charCo
by justinlardinois 10y ago
I'm a little confused; what's going on in the part of the main if condition after the &&? It looks like the author intended to check if any of e.which, e.charCode, or e.keyCode equal 9, but obviously that's not what would happen.
- 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