当前位置:网站首页>Flatten arrays
Flatten arrays
2022-04-23 08:05:00 【Pen drawing Acacia】
let flatten = (nestedList) => {
let result = [];
let fn = function(target, ary) {
for (let i = 0; i < ary.length; i++) {
let item = ary[i];
if (Array.isArray(ary[i])) {
fn(target, item);
} else {
target.push(item);
}
}
}
fn(result, nestedList) return result;
}
版权声明
本文为[Pen drawing Acacia]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230624332568.html
边栏推荐
猜你喜欢
Sto with billing cross company inventory dump return
Research on software security based on NLP (2)
Ctf-misc summary
SAP GUI安全性
Cloud computing skills competition -- Part 2 of openstack private cloud environment
国基北盛-openstack-容器云-环境搭建
高精度焊接机械臂定位
How does feign integrate hystrix
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface
内网渗透系列:内网隧道之pingtunnel
随机推荐
Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)
vivo,硬件安全的爱与雷霆
Talk about the essence of interface idempotent and consumption idempotent
LeetCoed18. 四数之和
Ctf-misc summary
Internal network security attack and defense: a practical guide to penetration testing (IV): Authority improvement analysis and defense
BUUCTF MISC刷题
Using lambda expression to solve the problem of C file name sorting (whether it is 100 or 11)
一文了解系列,对web渗透的常见漏洞总结(持续更新)
《内网安全攻防:渗透测试实战指南》读书笔记(五):域内横向移动分析及防御
KCD_ EXCEL_ OLE_ TO_ INT_ Convert reports an error sy subrc = 2
How does Apache Hudi accelerate traditional batch mode?
【问题解决】VS2019解决编译生成的exe文件打不开的情况
Implementation principle of instanceof
【编程实践/嵌入式比赛】嵌入式比赛学习记录(一):TCP服务器和web界面的建立
Summary of facial classics
一些关于网络安全的好教程或笔记的链接,记录一下
LeetCode15. 三数之和
内网渗透系列:内网隧道之icmptunnel(DhavalKapil师傅的)
[problem solving] vs2019 solves the problem that the EXE file generated by compilation cannot be opened