Skip to content

Instantly share code, notes, and snippets.

@klochner
Last active March 18, 2016 18:05
const merge = (a1, a2) => {
const a22 = a2.slice();
return a1.reduce((out, e) => {
const index = a22.findIndex((i) => {return i > e});
return out.concat(a22.splice(0,index)).concat([e]);
}, []).concat(a22);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment