|
|
|
|
|
by tjallingt
3355 days ago
|
|
```
var dividers = {
2: function divideBy2 (lhs, unused) {
return lhs >> 1
},
4: function divideBy4 (lhs, unused) {
return lhs >> 2
},
undefined: function divideByNumber (lhs, rhs) {
return lhs / rhs
}
}
``` Does this actually work? I tried it out in the Chrome Debugger and it didn't work. It looks like the author is confusing it with Rusts match statement. |
|