๐ก ํน์ ํ ์ด๋ฆ์ ๋ณ์๋ ํ ํ์ผ์์ ํ ๋ฒ๋ง ์ ์ธํ ์ ์๋ค. ๋ง์ฝ ๊ฐ์ ์ด๋ฆ์ผ๋ก ๋ณ์๋ฅผ ํ ๋ฒ ๋ ์ ์ธํ๋ฉด ์ค๋ฅ ๋ฐ์
<script>
let name = "name์ด๋ผ๋ ์ด๋ฆ์ ๋ณ์๋ฅผ ์ ์ธํฉ๋๋ค"
let name = "ํ ๋ฒ ๋ ์ ์ธํด๋ณผ๊ฒ์"
</script>
Uncaught SyntaxError: Identifier 'name' has already been declared
ํด๊ฒฐ ๋ฐฉ๋ฒ
<script>
let nameA = "name์ด๋ผ๋ ์ด๋ฆ์ ๋ณ์๋ฅผ ์ ์ธํฉ๋๋ค"
let nameB = "ํ ๋ฒ ๋ ์ ์ธํด๋ณผ๊ฒ์"
</script>
'Programming Language > JavaScript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[JavaScript] Bind()์ด๋? (0) | 2024.10.16 |
---|---|
[JavaScript] Assignment to constant variable (0) | 2024.06.12 |
[JavaScript] Missing initializer in const declaration (0) | 2024.06.12 |
[JavaScript] Identifier has already declared (0) | 2024.06.12 |
[JavaScript] Uncaught SyntaxError: Unexpectedidentifier (0) | 2024.06.12 |