ES6-specific: avoid Function#bind()
Self-explanatory, 7 bytes saved
f.bind(null,x,...xs)
_=>f(x,...xs)
Use sloppy mode to avoid variable declarations
Here, 8 bytes saved
a.forEach(e=>{let b=e+1,c=d(b)+2;f(e);g(b);h(c);i(b,c)})
a.forEach(e=>{f(e);g(b=e+1);h(c=d(b)+2);i(b,c)})
// Even better, reuse variables and use `Array#map()`
// Drops an additional 6 bytes
a.map(e=>{f(e++);g(e);h(b=d(e)+2);i(e,b)})
This also holds in ES5. Here, 8 bytes saved
a.forEach(function(e){let b=e+1,c=d(b)+2;f(e);g(b);h(c);i(b,c)})
a.forEach(function(e){f(e);g(b=e+1);h(c=d(b)+2);i(b,c)})
// Even better, reuse variables and use `Array#map()`
a.map(function(e){f(e++);g(e);h(b=d(e)+2);i(e,b)})
var
)? And should JavaScript golf code be a function or output something directly? I honestly think this can make much difference. \$\endgroup\$ – pimvdb May 27 '11 at 5:28