摘要:
isNaN(parseFloat(value)) && isFinite(value); 参考链接:https://blog.csdn.net/qq_23365135/article/details/123833406 阅读全文
摘要:
flat 函数第一个参数为需要扁平化的数组,第二个参数为需要打平的层数,默认不传则打平一层,传入几则代表打平几层。 测试用例 const arr = [1, [2], [3, [4, [5]]]]; console.log(flat(arr)); // [1, 2, 3, [4,[5]]] cons 阅读全文