daily pastebin goal
13%
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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top