Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const isArr = arg => Object.prototype.toString.call(arg) === '[object Array]'
- const flat = inputAny =>
- (
- isArr(inputAny[0])
- ? flat(inputAny[0])
- : [inputAny[0]]
- )
- .concat(
- inputAny.length > 1
- ? flat(inputAny.slice(1))
- : []
- )
- export default flat
Add Comment
Please, Sign In to add comment