When checking element presence in inline arrays via the in keyword, CoffeeScript ignores indexOf and rather does that many equality checks.
However, when referring to an array via a variable, it calls indexOf as expected.
Input
foo = 1
# -----------
foo in [1, 2, 3, 4, 5]
# -----------
bar = [1, 2, 3, 4, 5]
foo in bar
Output
var bar, foo,
indexOf = [].indexOf;
foo = 1;
// -----------
foo === 1 || foo === 2 || foo === 3 || foo === 4 || foo === 5;
// -----------
bar = [1, 2, 3, 4, 5];
indexOf.call(bar, foo) >= 0;
Demo code: Link
I find this intriguing. Any ideas why?