js知识 js 变量const 用来声明常量let 用来声明变量 js 函数不声明函数返回值 12345678//常用这种箭头函数const add = (a, b) => a + b;console.log(add(3, 5)); // 8//与下面等价function add(a, b) { return a + b;}console.log(add(3, 5)); // 8 js 回调函数作为参数传递给另一个函数 12const square = (n, callback) => callback(n * n);square(5, result => console.log(result)); // 25 js 里面解构赋值语法123const { list, total } = data.data自动匹配字段:从 data.data 对象中查找 list 和 total 属性自动赋值:将找到的属性值分别赋值给同名的变量 list 和 total 知识 js知识 http://www.981928.xyz/2025/11/04/js知识/ 作者 981928 发布于 2025年11月4日 许可协议 C++知识 上一篇 vue知识 下一篇 Please enable JavaScript to view the comments