# 运算符...典型的三种用处
1. 扩展运算符 (多用在解构赋值中)
```js
let [n, ...m] = [12,23,34];
console.log(n,m);
// n: 12
// m: [23,34]
- 展开运算符 (多用在传递实参中)
// 传递实参 let ary = [12,23,13,24,10,25]; let min = Math.min(...ary); console.log(min); // 数组克隆 (浅克隆) ----传递了引用给这个新的数组 let cloneAry = [..arg]; // 对象克隆 (浅克隆) let obj = {name:"帅哥"}; let cloneObj = {...obj};
- 剩余运算符 (多用在接受实参中)
let fn = (n, ...arg) =>{
// arg在函数体内为数组
console.log(n,arg);
}
fn(10,11,11,23,34);