Skip to content

Instantly share code, notes, and snippets.

@StanAngeloff
Created March 30, 2010 22:56
Show Gist options
  • Save StanAngeloff/349718 to your computer and use it in GitHub Desktop.
Save StanAngeloff/349718 to your computer and use it in GitHub Desktop.
[left[0...1], right[0..1]]: [right[0..1], left[0...1]]
(function(){
var _a, _b, _c;
var __range = function(array, from, to, exclusive) {
return [
(from < 0 ? from + array.length : from || 0),
(to < 0 ? to + array.length : to || array.length) + (exclusive ? 0 : 1)
];
};
_a = [right.slice.apply(right, __range(right, 0, 1, false)), left.slice.apply(left, __range(left, 0, 1, true))];
left.splice.apply(left, [(_b = __range(left, 0, 1, true))[0], _b[1] - _b[0]].concat(_a[0]))
right.splice.apply(right, [(_c = __range(right, 0, 1, false))[0], _c[1] - _c[0]].concat(_a[1]))
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment