04 2021 档案

摘要://回文数判断 let num = 121; let num2 = 1221; let num3 = -121; //判断回文数 fn = (num) => { let arr = String(num).split(""); let newArr = arr.reverse(); // conso 阅读全文
posted @ 2021-04-12 23:03 AUSER 阅读(59) 评论(0) 推荐(0)
摘要:js二维数组展平 //将 arr=[1,[2],[3,4],[4,[5,6]]] 展平 let arr = [1, [2], [3, 4], [4, [5, 6]], 7]; // 方法一 遍历 function flattenMd(arr) { let res = []; function fla 阅读全文
posted @ 2021-04-12 22:53 AUSER 阅读(76) 评论(0) 推荐(0)