摘要:
方法一: function format(num) { let str = num + ""; return str .split("") .reverse() .reduce((prev, next, index) => { return (index % 3 ? next : next + ", 阅读全文
摘要:
function newFilter(arr, fn) { let newArr = []; for (let i; i < arr.length; i++) { if (fn(arr[i])) { newArr.push(arr[i]); } } return newArr; } 阅读全文
摘要:
话不多说,上代码 function deepClone(obj) { let newObj = null; if (typeof obj "object") { newObj = obj instanceof Array ? [] : {}; for (let i in obj) { newObj[ 阅读全文