If it only does `===`, then it's not much better than switch. It would be interesting to see a pattern matching proposal that was extensible/customizable, perhaps via a well-known Symbol method.
On Fri, Jun 30, 2017 at 9:06 AM, Andreas Rossberg <[email protected]> wrote: > On 30 June 2017 at 15:55, Henrik Sommerland <[email protected]> > wrote: > >> Why is there no support for pattern matching in JavaScript? >> I would guess that it has been proposed before, and if so why hasn't it >> been included? >> >> I have been thinking about it and I think it would integrate nicely into >> JavaScript. >> If it hasn't been proposed already I would propose it, and I would gladly >> look into it more and try to examine what kind of semantics would be >> suitable. >> > > Long ago there was a proposal: > > https://web.archive.org/web/20111206195512/http://wiki. > ecmascript.org/doku.php?id=strawman:pattern_matching > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

