I hereby claim:
- I am beuhug on github.
- I am beuhug (https://keybase.io/beuhug) on keybase.
- I have a public key ASDTpCi-E4CgIKarjDKMRDJ5Z_fbeCDbLU-y2A7HJwLHJgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
let flattener = function(nestedArray) { | |
return nestedArray.reduce((result, value) => { | |
let valueToConcat = Array.isArray(value) ? flattener(value) : value | |
return result.concat(valueToConcat) | |
}, []); | |
} | |
console.log(flattener([[1,2,[3]],4])) |