์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- emtion app router
- ๋ฐฑ์ค 1339๋ฒ nodejs
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ์ค์ฝํ
- ์ต์ ๋์ฒด์ด๋
- suspense ๋น๋๊ธฐ
- suspense ๋์์๋ฆฌ
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- next13 emotion
- ๋ฐฑ์ค 2108 nodejs
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- ๊ตฌ๋ฆํค
- js ๋ฌธ์์ด ์์ถ
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ์นด์นด์ค ์ฝํ
- js ์ค์ฝํ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ๋ฐฑ์ค 1339๋ฒ js
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- suspense react-query
- js
- ์ฌ์ฉ์ฑ ๊ฐ์
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- suspense ๋ณ๋ชฉํ์
- emotion RSC
- app router emotion
- Today
- Total
Lennon FE
๋ฐฐ์ด์์๋ join("").substring() ๋์ slice().join("")์ ๋ณธ๋ฌธ
๋ฐฐ์ด์์๋ join("").substring() ๋์ slice().join("")์
Lennon 2021. 11. 5. 17:14substring๊ณผ slice ํ์ฉํ๋ฉด์ ๋๋ ์
์ด๋ค ๋ฌธ์ ๊ฐ ๊ณ์ ๋ช ๊ฐ๊ฐ ํ๋ฆฌ๋ ์ํฉ์ด ๋ฐ์ํ๋ค. ์ด๋ ต์ง ์์ ๋ฌธ์ ๋ผ ๋ก์ง์ ๋ฌธ์ ๊ฐ ์์๊ณ
๊ณ ๋ฏผํ๋์ฐจ ๋ฌธ์ ์ ์ ์ฐพ์๋ค.
๋ฐฐ์ด arr = [1, 2, 4, 5] ๊ฐ ์์ด์ 4์5, 1๊ณผ2๋ฅผ ๋ฐ๋๋ก ์ ๋ ฌํ๊ณ ๋ฌธ์์ด๋ก ๋ฆฌํดํ๊ณ ์ถ๋ค.
๊ทธ๋ฌ๋ฉด 0~2๊น์ง ์๋ฅด๊ณ , 3~ ์๋ฅธ ๊ฑธ ๋ถ์ฌ์ฃผ๋ฉด ๋๋ค. ๊ทธ๋ผ ๊ฒฐ๊ณผ์ ์ผ๋ก '4512'๊ฐ ๋ ๊ฒ์ด๋ค.
์ด๋ slice ํ join์ ํ๋ join์ ํ๊ณ substring์ ํด๋ ์๊ด์ด ์๋ค.
(๋ฌผ๋ก ์๋ก์ด ๋ฐฐ์ด์ ๋ง๋ค๊ณ ์๋ณธ ๋ฐฐ์ด์ ๋ณด์กดํด์ผํจ)
๊ทธ๋ฌ๋ ๋ฐฐ์ด ๋ด์ ์์๋ 10์ ์๋ฆฌ ์ด์์ ์๊ฐ ์๋ค๋ฉด ๋ง์ด ๋ฌ๋ผ์ง๋ค.
์ด๋ substring์ ํ๋ฉด ์ํ๋ ๊ฐ์ ๊ฐ์ง ์ ์์ ๊ฒ์ด๋ค.
๋ฐฐ์ด๋ก ์ฃผ์ด์ง๋ฉด ๋ฌด์กฐ๊ฑด slice๋ฅผ ์ฌ์ฉํ๋๋ก ํ์
'๐ฅ Algorithm > Algorithm Retrospect' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค 2108๋ฒ] ํต๊ณํ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.01.26 |
---|