mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
Before ES2016, `indexOf` and jQuery's `inArray` were used more often. They return -1 for a missing element, and 0 is the only integer that’s falsy, so -1 is the only integer whose bitwise complement is falsy. Using bitwise not (~) like this is no longer common practice and is a lot more confusing to read. Now that we have `includes` we can use that instead.