Our volunteers haven't translated this article into עברית yet. Join us and help get the job done!
You can also read the article in English (US).

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

Document Tags and Contributors

 Contributors to this page: nmve, fscholz
 Last updated by: nmve,