[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Errors/No_variable_name [Back]  [Original]

SyntaxError: missing variable name - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

SyntaxError: missing variable name

    SyntaxError: missing variable name (Firefox)
    SyntaxError: Unexpected token = (Chrome)

In this article

SyntaxError

?

. . , . ! .

js
var = "foo";

. .

js
var ohGodWhy = "foo";

. . . :(

js
var debugger = "whoop";
// SyntaxError: missing variable name

. ? ?

js
var x, y = "foo",
var x, = "foo"

var first = document.getElementById('one'),
var second = document.getElementById('two'),

// SyntaxError: missing variable name

:

js
var x,
  y = "foo";
var x = "foo";

var first = document.getElementById("one");
var second = document.getElementById("two");

JavaScript Array . .

js
var arr = 1,2,3,4,5;
// SyntaxError: missing variable name

:

js
var arr = [1, 2, 3, 4, 5];


Web Proxy Viewer  |  New URL  |  Original Page