Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Feb 22nd, 2018
75
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.19 KB
| None
|
0
0
raw
download
clone
embed
print
report
function flatten(arr) {
return arr.reduce(function (flat, toFlatten) {
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten);
}, []);
}
flatten([[1,2,[3]],4]);
Add Comment
Please,
Sign In
to add comment
Public Pastes
[JS] ADOBE FIREFLY IMAGE GENERATOR
JavaScript | 8 min ago | 0.74 KB
Untitled
C | 14 min ago | 0.45 KB
Untitled
C# | 17 min ago | 23.06 KB
Swap
Email | 19 min ago | 0.21 KB
Yuga Labs Sells 2 NFT Gaming IPs to Faraway A...
PHP | 26 min ago | 0.09 KB
USDC Issuer Circle Successfully Completes SOC...
PHP | 35 min ago | 0.09 KB
Cardano Foundation Unveils Interim Constituti...
PHP | 44 min ago | 0.10 KB
🤑 G2A.com Free Gift Card Guide Apr 2024 FIX 🤑
GetText | 57 min ago | 0.39 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!