当前位置:网站首页>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
边栏推荐
- C 输出一种二维数组,特点如下。
- 惨了,搞坏了领导的机密文件,吐血分享备份文件的代码技巧
- Intranet penetration series: icmpsh of Intranet tunnel
- Buctf MISC brossage
- 《内网安全攻防:渗透测试实战指南》读书笔记(七):跨域攻击分析及防御
- 数据库之MySQL——基础篇
- Research on system and software security (4)
- 从零开始完整学习机器学习和深度学习,包括理论和代码实现,主要用到scikit和MXNet,还有一些实践(kaggle上的)
- [programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP
- Chapter IV intangible assets
猜你喜欢
内网渗透系列:内网隧道之icmpsh
内网渗透系列:内网隧道之icmptunnel(DhavalKapil师傅的)
Série de pénétration Intranet: icmpsh du tunnel Intranet
Research on software security based on NLP (2)
DVWA靶场练习
Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)
Chapter IV intangible assets
LeetCode 1611. 使整数变为 0 的最少操作次数
Using lambda expression to solve the problem of C file name sorting (whether it is 100 or 11)
C problem of marking the position of polygons surrounded by multiple rectangles
随机推荐
从零开始完整学习机器学习和深度学习,包括理论和代码实现,主要用到scikit和MXNet,还有一些实践(kaggle上的)
Intranet penetration series: dnscat2 of Intranet tunnel
Principle of sentinel integrating Nacos to update data dynamically
聊聊接口幂等与消费幂等的本质
C smoothprogressbar custom progress bar control
SAP GUI security
DVWA靶场练习
SAP GUI安全性
LeetCode15. 三数之和
MySQL -- the secret of lock -- how to lock data
Ribbon启动流程
Série de pénétration Intranet: icmpsh du tunnel Intranet
SAP tr manual import system operation manual
简述CPU
Intranet security attack and defense: a practical guide to penetration testing (6): domain controller security
学fpga(从verilog到hls)
内网渗透系列:内网隧道之dnscat2
输入 “ net start mysql ”,出现 “ 发生系统错误 5。 拒绝访问 ” 。问题详解
Internal network security attack and defense: a practical guide to penetration testing (5): analysis and defense of horizontal movement in the domain
Implementation principle of instanceof