当前位置:网站首页>数组扁平化
数组扁平化
2022-04-23 06:25:00 【笔描相思】
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;
}
版权声明
本文为[笔描相思]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44788119/article/details/120920299
边栏推荐
- SAP pi / PO rfc2restful publishing RFC interface is a restful example (proxy indirect method)
- SAP PI/PO rfc2Soap 发布rfc接口为ws示例
- OpenGL超级宝典初步配置(freeglut、glew、gltools、glut)
- 配置npm
- Applet newline character \ nfailure problem resolution - Daily pit stepping
- SAP Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃。
- js之自定义属性以及H5中如何判断自定义属性
- Hot change scheme and dynamic update strategy of mobile game
- SAP PI / Po rfc2restful Publishing RFC interface as restful examples (proxy indirect)
- Educational Codeforces Round 81 (Rated for Div. 2)
猜你喜欢

BTree、B+Tree和HASH索引

Authorization+Token+JWT

SAP pi / PO rfc2restful publishing RFC interface is a restful example (proxy indirect method)

keytool: command not found

Mysql 数据库从设计上的优化

BTREE, B + tree and hash index

SAP 03-AMDP CDS Table Function using ‘WITH‘ Clause(Join子查询内容)

Authorization server (simple construction of authorization server)

‘npm‘不是内部或外部命令,也不是可运行的程序 或批处理文件

js之预解析
随机推荐
【TED系列】如何与内心深处的批评家相处?
OpenGL超级宝典初步配置(freeglut、glew、gltools、glut)
ogldev-读书笔记
Reflection on the systematic design of Android audio and video caching mechanism
Applet Wx Previewmedia related problem solving - Daily stepping on the pit
F-牛妹的苹果树(直径合并)
简单理解==和equals,String为什么可以不用new
BTree、B+Tree和HASH索引
数据分析入门 | kaggle泰坦尼克任务(三)—>探索数据分析
ABAP 从CDS VIEW 发布OData Service示例
8. Paging query
简易随机点名抽奖(js下编写)
ABAP 7.4 SQL Window Expression
数论分块(整除分块)
Moment.js中format方法函数的格式
12.约束
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
Learn to use search engines
Nacos / sentinel gateway current limiting and grouping (code)
安装配置淘宝镜像npm(cnpm)