---
# System prepended metadata

title: 【js筆記】展開與其餘
tags: [JAVASCRIPT]

---

---
tags: JAVASCRIPT
---
【js筆記】展開與其餘
===
```javascript=
let groupA = ['小明', '杰倫', '阿姨'];
let groupB = ['老媽', '老爸'];
let groupAll = [...groupA, ...groupB]
```
```javascript=
var originCash = 1000;
function updateEasyCard() {
  let arg = [...arguments]
  console.log(arg)
  let sum = arg.reduce(function (accumulator, currentValue) {
    return accumulator + currentValue;
  }, 0);
  console.log('我有 ' + sum + ' 元');
}
updateEasyCard(0); // 我有 1000 元
updateEasyCard(10, 50, 100, 50, 5, 1, 1, 1, 500); // 我
```

```javascript=
function moreMoney(ming, ...money) {
  console.log(ming, money);
}
moreMoney('小明', {name: '小華'}, 100, 200, 300, 400)
```