当前位置:网站首页>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
边栏推荐
- KVM安装部署
- Go语学习笔记 - 语言接口 | 从零开始Go语言
- 内网渗透系列:内网隧道之dnscat2
- Research on system and software security (3)
- 云计算技能大赛 -- openstack私有云环境 第一部分
- 利用sqlmap注入获取网址管理员账号密码
- 求3个字符串(每串不超过20个字符)中的最大者。
- Research on software security based on NLP (2)
- A series of articles, a summary of common vulnerabilities of Web penetration (continuously updated)
- 数据安全问题已成隐患,看vivo如何让“用户数据”重新披甲
猜你喜欢

CTF攻防世界刷题51-

Ribbon start process

C problem of marking the position of polygons surrounded by multiple rectangles

三星,再次“西征”

Buctf MISC brossage

Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)

SAP GUI security

雲計算技能大賽 -- openstack私有雲環境 第一部分

数据安全问题已成隐患,看vivo如何让“用户数据”重新披甲

內網滲透系列:內網隧道之icmpsh
随机推荐
内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)
MySQL -- the secret of lock -- how to lock data
How does feign integrate hystrix
Redis transaction implements optimistic locking principle
Ctf-misc summary
C read INI file and write data to INI file
Ctf-misc learning from start to give up
巨头押注的全屋智能,正在驱动海信、华为、小米们「自我革命」
Analysis of Nacos source code
Go语学习笔记 - 异常处理 | 从零开始Go语言
Intranet penetration series: pingtunnel of Intranet tunnel
Flutter之Provider共享数据的两种方式
Série de pénétration Intranet: icmpsh du tunnel Intranet
Quick rehearsal exercise
GUI,CLI与Unix哲学
内网渗透系列:内网隧道之dnscat2
Three minutes to teach you to use Houdini fluid > > to solve particle fluid droplets
A series of articles, a summary of common vulnerabilities of Web penetration (continuously updated)
雲計算技能大賽 -- openstack私有雲環境 第一部分
CTF攻防世界刷题51-