RT @mathias: JavaScript tip:
if (foo === x || foo === y) {}
→
if (~[x, y].indexOf(foo)) {}
Saves repeated property lookups here: htt …
RT @mathias: JavaScript tip:
if (foo === x || foo === y) {}
→
if (~[x, y].indexOf(foo)) {}
Saves repeated property lookups here: htt …