please add orEqual operator
Andrea Giammarchi
andrea.giammarchi at gmail.com
Mon Aug 10 17:56:20 UTC 2015
well
On Mon, Aug 10, 2015 at 6:15 PM, joe <joeedh at gmail.com> wrote:
> I actually like `[1, 2, 3, 4, 5, 6].contains(a)` better, too. The
> question is, will engines actually optimize it.
>
>
if the entire environment never touches even "by accident" the
`Array.prototype` I don't see why that couldn't be optimized by the engine
... but in general, if a *small* `Array#contains` is the performance
bottleneck of any application I think there's probably something else
wrong there, or maybe the only better performance approach would be a
`switch` with all cases well defined with a `break` (as someone somewhere
suggested once about a speedy subset of JS)
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150810/81169253/attachment.html>
More information about the es-discuss
mailing list