Created
July 31, 2018 11:21
-
-
Save matteoterrinoni/05d225170a32a1365e592a7d70e25a33 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const flatter = (arr) => | |
Array.isArray(arr) && [].concat(...arr.map(a=>flatter(a))) || +arr | |
export default flatter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment