function copyAttrExcept(source, ...args) {
  let res = {};
  for (const attr in source) {
    if (source.hasOwnProperty(attr) && args.every((ele) => ele !== attr)) {
      res[ attr ] = source[ attr ];
    }
  }
  return res;
}

function zeroArr(length) {
  return [ ...Array(length) ].map(_ => 0);
}


export const tools = {
  copyAttrExcept,
  zeroArr
}
@@ -235,71 +235,478 @@
 ion 
-zeroArr(length) %7B%0A  return %5B ...Array(length) %5D.map(_ =%3E 0);%0A%7D%0A
+copyAttr(target, source, cover) %7B%0A  for (const attr in source) %7B%0A    if (source.hasOwnProperty(attr)) %7B%0A      if (!target.hasOwnProperty(attr)) %7B%0A        target%5B attr %5D = source%5B attr %5D;%0A      %7D else if (cover) %7B%0A        target%5B attr %5D = source%5B attr %5D;%0A      %7D%0A    %7D%0A  %7D%0A  return target;%0A%7D%0A%0Afunction zeroArr(length) %7B%0A  return %5B ...Array(length) %5D.map(_ =%3E 0);%0A%7D%0A%0Afunction generalKey() %7B%0A  let i = 1;%0A  if(i %3E 1000)%7B%0A    i = 1;%0A  %7D%0A  return Date.now().toString() + i;%0A%7D
 %0A%0Aex
@@ -753,10 +753,36 @@
  zeroArr
+,%0A  copyAttr,%0A  generalKey
 %0A%7D

添加工具函数 #1