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 | 29 | 30 | 31 |
Tags
- ์ค์ฝํ
- suspense ๋์์๋ฆฌ
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- emotion RSC
- next13 emotion
- emtion app router
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ์ฌ์ฉ์ฑ ๊ฐ์
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- ๊ตฌ๋ฆํค
- ๋ฐฑ์ค 1339๋ฒ nodejs
- suspense ๋ณ๋ชฉํ์
- ์นด์นด์ค ์ฝํ
- js
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- js ๋ฌธ์์ด ์์ถ
- js ์ค์ฝํ
- ๋ฐฑ์ค 2108 nodejs
- suspense ๋น๋๊ธฐ
- ๋ฐฑ์ค 1339๋ฒ js
- app router emotion
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- suspense react-query
- ๋ฐฑ์ค 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