Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created August 6, 2010 20:15
Show Gist options
  • Select an option

  • Save cowboy/511930 to your computer and use it in GitHub Desktop.

Select an option

Save cowboy/511930 to your computer and use it in GitHub Desktop.
Some hawt splice-on-splice action for JD
// The basic premise, splicing data into an array used as a map of some sort
// (assume that numbers 1-9 are placeholders for legitimate splice args)
m = Array(100);
s = 'splice';
m[s](1);
m[s](2);
m[s](3); // do this kind of thing many times
// Before:
m=Array(100);
m[s='splice'](1);m[s](2);m[s](3);m[s](4);m[s](5);m[s](6);m[s](7);m[s](8);m[s](9)
// After (becomes smaller at the 9th splice):
m=Array(100);
(function s(){m.splice.apply(m,arguments);return s})(1)(2)(3)(4)(5)(6)(7)(8)(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment