Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

SyntaxError: missing ] after element list

Naši dobrovolníci ještě tento článek do jazyka Čeština nepřeložili. Přidejte se a pomozte nám tuto práci dokončit!

Message

SyntaxError: missing ] after element list

Error type

SyntaxError.

What went wrong?

There is an error with the array initializer syntax somewhere. Likely there is a closing bracket ("]") or a comma (",") missing.

Examples

Incomplete array initializer

var list = [1, 2,

var instruments = [
  "Ukulele",
  "Guitar",
  "Piano"
};

var data = [{foo: "bar"} {bar: "foo"}];

Correct would be:

var list = [1, 2];

var instruments = [
 "Ukulele",
 "Guitar",
 "Piano"
]; 

var data = [{foo: "bar"}, {bar: "foo"}];

See also

Štítky a přispěvatelé do dokumentace

 Přispěvatelé této stránky: fscholz
 Poslední aktualizace od: fscholz,