์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- js ๋ฌธ์์ด ์์ถ
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ์ค์ฝํ
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- emtion app router
- suspense ๋น๋๊ธฐ
- ๋ฐฑ์ค 1339๋ฒ js
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- suspense ๋ณ๋ชฉํ์
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- emotion RSC
- ๋ฐฑ์ค 2108 nodejs
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ๋ฐฑ์ค 1339๋ฒ nodejs
- ์ฌ์ฉ์ฑ ๊ฐ์
- ์นด์นด์ค ์ฝํ
- next13 emotion
- ๊ตฌ๋ฆํค
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- app router emotion
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- js
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- suspense react-query
- suspense ๋์์๋ฆฌ
- js ์ค์ฝํ
- ์ต์ ๋์ฒด์ด๋
- Today
- Total
Lennon FE
[JavaScript] ๊ณ ์ฐจํจ์ ๋ณธ๋ฌธ
๊ณ ์ฐจํจ์๋ ํจ์๋ฅผ ๊ฐ์ผ๋ก ๋ค๋ฃจ๋ ํจ์์ด๋ค.
ํจ์๋ฅผ ์ธ์๋ก ๋ฐ์์ ์คํํ๋ ํจ์๋ค์ ์ดํด๋ณด์.
const funcAdd = f => f(1);
const add10 = a => a + 10;
console.log(funcAdd(add10));
์ funcAdd ํจ์๋ console.log์์ ์ธ์๋ก add10ํจ์๋ฅผ ๋ฐ๋๋ค.
๋น์ฐํ๊ฒ ๊ฒฐ๊ณผ๋ 11๋ก ์์ํ ์ ์๋ค.
ํจ์๋ฅผ ๋ง๋ค์ด ๋ฆฌํดํ๋ ๊ฒฝ์ฐ๋ ์๋ค. ์ด๋ฐ ๊ฒฝ์ฐ๋ฅผ ํด๋ก์ ๋ฅผ ๋ง๋ค์ด ๋ฆฌํดํ๋ ํจ์๋ผ๊ณ ๋งํ๋ค.
ํจ์๊ฐ ํจ์๋ฅผ ๋ง๋ค์ด์ ๋ฆฌํดํ ๋๋ ๊ฒฐ๊ตญ์ ํด๋ก์ ๋ฅผ ๋ง๋ค์ด์ ๋ฆฌํดํ๊ธฐ ์ํด ์ฌ์ฉํ๋ค.
์๋ ์์๋ฅผ ํ์ธํด๋ณด์, ์ฐ๋ฆฌ๊ฐ ์จ๋ณด์ง ๋ชปํ ๋๋์ arrow Func ๋ก ์ ํ์๋ค.
const add = a => b => a + b;
const add10 = add(10);
์ add10์ console๋ก ์ฐ์ด๋ณด๋ฉด
b => a + b๊ฐ ๋ฆฌํด๋๋ค.
๊ทธ๋ฌ๋ add10 ํจ์์์ ํ์ฌ a๊ฐ์ 10์ผ๋ก ์ ์๋์ด ์๊ธฐ์ a๋ ํด๋ก์ ๋ก ๋์ํ๋ค. a์ ๊ฐ์ ํญ์ 10์ผ๋ก ๊ธฐ์ต๋๋๋ก ํด๋ก์ ๊ฐ ๋ง๋ค์ด์ ธ ์๋ค.
const add = a => b => a + b;
const add10 = add(10);
console.log(add10(5));
console.log(add10(10));
์ ๊ฒฐ๊ณผ๋ ๋น์ฐํ 15, 20์ด ์ถ๋ ฅ๋๋ ๊ฑธ ํ์ธํ ์ ์๋ค.
arrow func์ด ํ ํจ์์ ์ฐ์์ผ๋ก ์ฌ๋ฌ๊ฐ ์ ์๋์ด ์์ผ๋ฉด ๊ทธ๋ฅ ๊ฐ๋จํ๊ฒ ํด๋ก์ ๋ก ๋์ํ๊ธฐ ์ํ ํจ์๋ผ๋ ์ดํดํ๊ณ ๋์ด๊ฐ์!
'๐งโ๐ป Web > JavaScript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[JavaScript] Array, Set, Map์ ํตํด ์์๋ณด๋ ์ดํฐ๋ฌ๋ธ/์ดํฐ๋ ์ดํฐ (0) | 2022.07.19 |
---|---|
[JavaScript] lodash sortBy (0) | 2022.07.02 |
[JavaScript] ํ์ดํ ํจ์์ ์ผ๋ฐ ํจ์์ ์ฐจ์ด (0) | 2022.06.03 |
[heroku] nodejs ๋ฐฐํฌํ ๋ dotenv ์ฒ๋ฆฌ (0) | 2022.03.25 |
billboard.js ์ ๋ํด ์์๋ณด์. (pie chart ์์) (0) | 2022.03.24 |