Skip to content

Instantly share code, notes, and snippets.

@arschmitz
Created March 25, 2013 14:55
Show Gist options
  • Save arschmitz/5237680 to your computer and use it in GitHub Desktop.
Save arschmitz/5237680 to your computer and use it in GitHub Desktop.
(function( undefined ){
shoestring.merge = function( first, second ){
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return shoestring( first );
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment