pokemon-showdown/sim
Guangcong Luo 246dfa1da3 Refactor in-object-literal to array-includes (#4079)
Previously, if we wanted to test if A was either 'B' or 'C', we would use
the pattern:

    A in {B:1, C:1}

I actually don't know how common this pattern is; I just started using
it because I was tired of typing `A === 'B' || A === 'C'` all the time.
I never really liked it, though; the `:1` part made it kind of
blatantly a hack.

I did some testing and `['B', 'C'].includes(A)` is overall faster.

(A switch statement is around 20x faster still, but who wants to type
that much code?)

Anyway, the new standard is

    ['B', 'C'].includes(A)

Something something progress!
2017-10-23 09:19:15 -05:00
..
battle.js Refactor in-object-literal to array-includes (#4079) 2017-10-23 09:19:15 -05:00
dex-data.js Refactor in-object-literal to array-includes (#4079) 2017-10-23 09:19:15 -05:00
dex.js Refactor in-object-literal to array-includes (#4079) 2017-10-23 09:19:15 -05:00
index.js TypeScript: Improve Sim typing (#4069) 2017-10-20 07:53:26 -05:00
pokemon.js Refactor in-object-literal to array-includes (#4079) 2017-10-23 09:19:15 -05:00
prng.js Split random-teams.js out of scripts.js 2017-07-25 02:59:59 -04:00
side.js TypeScript: Improve Sim typing (#4069) 2017-10-20 07:53:26 -05:00