A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/ko/docs/Web/JavaScript/Reference/Errors/Identifier_after_number below:

SyntaxError: identifier starts immediately after numeric literal - JavaScript

SyntaxError: identifier starts immediately after numeric literal 메세지
  SyntaxError: Unexpected identifier after numeric literal (Edge)
  SyntaxError: identifier starts immediately after numeric literal (Firefox)
  SyntaxError: Unexpected number (Chrome)
에러 타입 무엇이 잘못되었을까?

식별자라고 불리는 변수의 이름은 반드시 지켜야 하는 특정 규칙을 따라야 합니다.

JavaScript의 식별자는 반드시 문자, 언더스코어(_), 또는 달러 표시($)로 시작돼야 합니다. 숫자로 시작될 수 없습니다. 글자 뒤에만 숫자(0-9)가 올 수 있습니다.

예제 숫자로 시작하는 변수 이름

JavaScript에서 변수 이름은 숫자로 시작될 수 없습니다. 아래 예제는 에러가 발생합니다:

var 1life = 'foo';
// SyntaxError: identifier starts immediately after numeric literal

var foo = 1life;
// SyntaxError: identifier starts immediately after numeric literal

alert(1.foo);
// SyntaxError: identifier starts immediately after numeric literal

숫자가 뒤에 오도록 변수 이름을 변경해야 합니다.

var life1 = "foo";
var foo = life1;
같이 보기

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4