Rick Waldron (2014-02-21T17:26:02.000Z)
On Fri, Feb 21, 2014 at 7:55 AM, Nick Krempel <ndkrempel at google.com> wrote:

> Also only works when you're switching on something with a meaningful
> conversion to string.
>

On 20 Feb 2014, at 21:20, Eric Elliott <eric at ericleads.com> wrote:

> Object literals are already a great alternative to switch in JS:
>
> var cases = {
>   val1:  function () {},
>   val2: function () {}
> };
>
> cases[val]();


Right, this wouldn't work if the "case" wanted object references, but it
would work nicely with Symbols.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140221/e8e1425b/attachment.html>
domenic at domenicdenicola.com (2014-02-24T21:28:48.233Z)
On Fri, Feb 21, 2014 at 7:55 AM, Nick Krempel <ndkrempel at google.com> wrote:

> Also only works when you're switching on something with a meaningful
> conversion to string.

On 20 Feb 2014, at 21:20, Eric Elliott <eric at ericleads.com> wrote:

> Object literals are already a great alternative to switch in JS:

Right, this wouldn't work if the "case" wanted object references, but it
would work nicely with Symbols.