Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- ๊ตฌ๋ฆํค
- emtion app router
- emotion RSC
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- app router emotion
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- ๋ฐฑ์ค 1339๋ฒ js
- js ๋ฌธ์์ด ์์ถ
- suspense ๋ณ๋ชฉํ์
- ๋ฐฑ์ค 1339๋ฒ nodejs
- suspense ๋์์๋ฆฌ
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- suspense ๋น๋๊ธฐ
- ์ต์ ๋์ฒด์ด๋
- js ์ค์ฝํ
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- ๋ฐฑ์ค 2108 nodejs
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ์นด์นด์ค ์ฝํ
- suspense react-query
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- ์ฌ์ฉ์ฑ ๊ฐ์
- next13 emotion
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- js
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ์ค์ฝํ
Archives
- Today
- Total
Lennon FE
[์๋ฐ์คํฌ๋ฆฝํธ] 2์ฐจ์ ๋ฐฐ์ด ๊น์ ๋ณต์ฌ ํ๊ธฐ ๋ณธ๋ฌธ
๐ง๐ป Web/JavaScript
[์๋ฐ์คํฌ๋ฆฝํธ] 2์ฐจ์ ๋ฐฐ์ด ๊น์ ๋ณต์ฌ ํ๊ธฐ
Lennon 2022. 3. 16. 22:59728x90
๋ฐ์ํ
์๋ฐ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ๋ค๊ฐ 2์ฐจ์ ๋ฐฐ์ด์ ๊น์ ๋ณต์ฌํด์ผํ ์ํฉ์ด ์ฌ ์๋ ์๋ค.
์๋์ฒ๋ผ ์ฐ๋ฆฌ๊ฐ ์๋๋๋ก ์งํํ๋ฉด ์๋ณธ ๋ฐฐ์ด์ ๊ฐ์ด ๊ณ์ ๋ฐ๋๋ ๊ฑธ ํ์ธํ ์ ์๋ค.
let arr1 = [[1,2,3],[2,3,4]]
let arr2 = [...arr1];
arr2[0][0] = 0;
console.log(arr1); // [[0,2,3],[2,3,4]]
console.log(arr2); // [[0,2,3],[2,3,4]]
์ด๋ ํฐํ์ธ arr1๋ง ๊น์ ๋ณต์ฌ๊ฐ ๋๊ณ ๊ฐ์ฅ ์ค์ํ ์์ ๋ฐฐ์ด ๊ฐ ํ๋ค์ ๋์ผํ ๊ฐ์ ์ฐธ์กฐํ๊ณ ์๋ค๋ ๊ฑธ(์์ ๋ณต์ฌ) ์๋ฏธํ๋ค.
2์ค ๋ฐฐ์ด์ ๊น์ ๋ณต์ฌํ๋ ค๋ฉด ๊ฐ ํ๋ง๋ค ๋์ผํ๊ฒ ๊น์ ๋ณต์ฌ ํด์ฃผ๋ฉด ๋๋ค.
let arr1 = [[1,2,3],[2,3,4]]
let arr2 = arr1.map(v => [...v]);
arr2[0][0] = 0;
console.log(arr1); // [[1,2,3],[2,3,4]]
console.log(arr2); // [[0,2,3],[2,3,4]]
728x90
๋ฐ์ํ
'๐งโ๐ป Web > JavaScript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[heroku] nodejs ๋ฐฐํฌํ ๋ dotenv ์ฒ๋ฆฌ (0) | 2022.03.25 |
---|---|
billboard.js ์ ๋ํด ์์๋ณด์. (pie chart ์์) (0) | 2022.03.24 |
datePicker๋ฅผ ์ฌ์ฉํด ๋ ์ง ๋ณ๊ฒฝ ์ ์ด๋ฒคํธ๋ฅผ ์ ์ฉํด๋ณด์. (0) | 2022.02.28 |
Netilfy ์๋ฐ์คํฌ๋ฆฝํธ ํ๋ก์ ํธ ๋ฐฐํฌํ ๋ API key ์จ๊ธฐ๊ธฐ (3) | 2022.02.12 |
[JS] ์๋ฐ์คํฌ๋ฆฝํธ ๋ฐฐ์ด ์๊ฐ ๋ณต์ก๋ (0) | 2022.01.28 |
Comments