08 2021 档案
摘要:在编写 JS 代码时,经常会遇到逻辑判断复杂的情况。一般情况下,可以用 if/else 或 switch 来实现多个条件判断,但会出现一个问题:随着逻辑复杂度的增加,代码中的 if/else 和 switch 会越来越臃肿 if (status == 1) { // 逻辑1 } else if (s
阅读全文
摘要:let newArr = [] allMonth.forEach(el=> { const res = newArr.findIndex(ol=> { return el.month ol.month; }); if (res !== -1) { newArr[res].value = newArr
阅读全文