---
# System prepended metadata

title: js  array
tags: [javaScript]

---

# js  array

https://www.youtube.com/watch?v=_vFuDQ_6Xt8
https://www.youtube.com/watch?v=R8rmfD9Y5-c&list=PLHSGusswGQ2_rXt6UTYuPunO7IanQgNlg&index=6
map array轉string 用join(放要替換,的 一般都用'');
![](https://i.imgur.com/YQ3dZ7W.png)


## array淺拷貝

只能對
`const numbers = [1, 2, 3, 4, 5];`
**CRUD之類都可以
更改屬性就不行
要用深拷貝**

多緯度就不行
```
 let car = [
      { id: 1, count: 1 },
      { id: 1, count: 1 }
    ];
    let newCar = [...car]
    newCar[0].count = 5;
    console.log(car[0], newCar[0]);
```

展開運算子・淺拷貝
Array.map
Array.filter 
Array.reduce
Array.slice




###### tags: `javaScript`