codestates / codestates/LearnRegex
[๐พ ErrorLog] ์ธ์ ์คํ ๋ฆฌ์ง์ ์ ์ฅ๋ ๊ฐ ๊ฐ์ ธ์ค๊ธฐ
- Lingua principale
- JavaScript
- Stelle
- 2
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
์ด๋ค ์๋ฌ์ธ๊ฐ?
* ์ธ์
์คํ ๋ฆฌ์ง๋ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋์ง ์๋ ์ด์ ๋ ๋ผ๊ฐ์ง ์๋๋ฐ, ์๋ก๊ณ ์นจ ํน์ ๋ค๋ก๊ฐ๊ธฐ ํ ๋๋ง๋ค ๊ฐ์ด `null` ๋ฐ๊ผ๋ค..
์๋ฌ ํด๊ฒฐ ๋ฐฉ๋ฒ
* ์ธ์
์คํ ๋ฆฌ์ง์ ์ ์ฅ๋ ๊ฐ์ `String`ํ์
์ด๋ค. ๋๋ `Number` ํ์
์ด ํ์ํ๊ธฐ ๋๋ฌธ์ `Number()`๋ฅผ ์์์คฌ๋ค.
```js
// ์ฒ์
useState(sessionStorage.getItem('current') || 0)
// ์ค๊ฐ
useState(sessionStorage.getItem(Number('current')) || 0)
// ๋ง์ง๋ง
useState(Number(sessionStorage.getItem('current')) || 0)
```
์๋ฌ ํด๊ฒฐ์ ์ํด ์ฐธ๊ณ ํ ๋ ํผ๋ฐ์ค ๋งํฌ
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non รจ ancora stata valutata.