ASCII码 ASCII码

参数过多的压缩例子

发布于:2022-06-07 11:53:23  栏目:技术文档

  1. f = (a ,b) => a+b;
  2. console.log(f(1,2,3,4));
  3. f = (...arr) => arr;
  4. console.log(f(0,1,2,3,4,5,6,7,8));
  5. console.log(...[1,2,3,4]);
  6. f = (a,b, ... arr) => `${a},${b},000000*****************,${arr}`
  7. console.log(f(1,2,3,4,5,6,7,8));
  8. f = (a,b,...arr) => `您好${arr}`
  9. console.log(f(1,2,3,4,5,6,7,8));
  10. const list = ["笔记本电脑","小米手机","佳能相机"];
  11. f = (...items) => items.map(item => `<li>${item}</li>`);
  12. console.log(f(...list));
相关推荐
阅读 +