Created
December 11, 2017 17:17
-
-
Save jgabriellima/4f35b98ef2737787634b0430257c9e4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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