daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest May 16th, 2018 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const isArr = arg => Object.prototype.toString.call(arg) === '[object Array]'
  2. const flat = inputAny =>
  3.   (
  4.     isArr(inputAny[0])
  5.       ? flat(inputAny[0])
  6.       : [inputAny[0]]
  7.   )
  8.   .concat(
  9.     inputAny.length > 1
  10.       ? flat(inputAny.slice(1))
  11.       : []
  12.   )
  13. export default flat
RAW Paste Data
Top