Comment

Comment by tjallingt

``` 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.

parent tjallingt 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton