Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Nov 24th, 2017
70
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.17 KB
| None
|
0
0
raw
download
clone
embed
print
report
function flatten (a) {
return [].concat( ...a.map(x => Array.isArray(x) ? flatten(x) : x) )
}
flatten([1, 2, [3, 4, [5], 6, [7, [8]]]])
// [ 1, 2, 3, 4, 5, 6, 7, 8 ]
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
Bash | 8 min ago | 7.64 KB
🤑 G2A.com Free Gift Card Guide Apr 2024 FIX 🤑
GetText | 9 min ago | 0.39 KB
RequestException: error with request
Python | 12 min ago | 3.24 KB
CASHAPP Free Amazon Giftcard
GetText | 18 min ago | 0.32 KB
🤑 G2A.com Free Gift Card Guide Apr 2024 FIX 💰
GetText | 18 min ago | 0.38 KB
ServerError: received 502 HTTP response
Python | 26 min ago | 2.98 KB
ServerError: received 502 HTTP response
Python | 28 min ago | 3.38 KB
RequestException: error with request
Python | 29 min ago | 2.84 KB
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
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!