当前位置:网站首页>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
边栏推荐
- Research on system and software security (4)
- Buuctf misc brush questions
- Chapter VII asset impairment
- CSV Column Extract列提取
- C smoothprogressbar custom progress bar control
- A series of articles, a summary of common vulnerabilities of Web penetration (continuously updated)
- MySQL -- the secret of lock -- how to lock data
- SAP self created table log function is enabled
- 內網滲透系列:內網隧道之icmpsh
- KCD_ EXCEL_ OLE_ TO_ INT_ Convert reports an error sy subrc = 2
猜你喜欢

Intranet penetration series: icmpsh of Intranet tunnel

内网渗透系列:内网隧道之pingtunnel

SAP tr manual import system operation manual

Research on software security based on NLP (2)

Go语学习笔记 - 异常处理 | 从零开始Go语言

在线YAML转XML工具

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

Internal network security attack and defense: a practical guide to penetration testing (5): analysis and defense of horizontal movement in the domain

【编程实践/嵌入式比赛】嵌入式比赛学习记录(一):TCP服务器和web界面的建立

The displayed amount of ABAP ALV is inconsistent with the exported amount
随机推荐
Guoji Beisheng openstack container cloud environment construction
DVWA靶场练习
C problem of marking the position of polygons surrounded by multiple rectangles
从ES、MongoDB、Redis、RocketMQ出发谈分布式存储
Learning records of some shooting ranges: sqli labs, upload labs, XSS
Go语学习笔记 - 异常处理 | 从零开始Go语言
数据安全问题已成隐患,看vivo如何让“用户数据”重新披甲
以下程序实现从字符串str中删除第i个字符开始的连续n个字
BUFFCTF文件中的秘密1
The displayed amount of ABAP ALV is inconsistent with the exported amount
Buuctf misc brush questions
Mysql database backup and recovery under Linux (full + incremental)
RAID0和RAID5的创建和模拟RAID5工作原理
读书笔记
Concours de compétences en informatique en nuage - - première partie de l'environnement cloud privé openstack
【编程实践/嵌入式比赛】嵌入式比赛学习记录(一):TCP服务器和web界面的建立
yum源仓库本地搭建的两种方法
Ignis公链的NFT生态发展:Unicorn.art的捐赠开发之路
BUUCTF [ACTF2020 新生赛]Include1
【问题解决】VS2019解决编译生成的exe文件打不开的情况