codestates / codestates/LearnRegex
[๐พ ErrorLog] ์ธ์ ์คํ ๋ฆฌ์ง์ ์ ์ฅ๋ ๊ฐ ๊ฐ์ ธ์ค๊ธฐ
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
์ด๋ค ์๋ฌ์ธ๊ฐ?
* ์ธ์
์คํ ๋ฆฌ์ง๋ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋์ง ์๋ ์ด์ ๋ ๋ผ๊ฐ์ง ์๋๋ฐ, ์๋ก๊ณ ์นจ ํน์ ๋ค๋ก๊ฐ๊ธฐ ํ ๋๋ง๋ค ๊ฐ์ด `null` ๋ฐ๊ผ๋ค..
์๋ฌ ํด๊ฒฐ ๋ฐฉ๋ฒ
* ์ธ์
์คํ ๋ฆฌ์ง์ ์ ์ฅ๋ ๊ฐ์ `String`ํ์
์ด๋ค. ๋๋ `Number` ํ์
์ด ํ์ํ๊ธฐ ๋๋ฌธ์ `Number()`๋ฅผ ์์์คฌ๋ค.
```js
// ์ฒ์
useState(sessionStorage.getItem('current') || 0)
// ์ค๊ฐ
useState(sessionStorage.getItem(Number('current')) || 0)
// ๋ง์ง๋ง
useState(Number(sessionStorage.getItem('current')) || 0)
```
์๋ฌ ํด๊ฒฐ์ ์ํด ์ฐธ๊ณ ํ ๋ ํผ๋ฐ์ค ๋งํฌ
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.