Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function flatten(data){
return [].concat.apply([],[].concat.apply([],data))
}
var result = flatten([[1,2,[3]],4]);
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment