Blue Moon
Blue Moon

Reputation: 189

Can I create an array like this in Javascript?

var row = [ [{text: [“##”]},{text: [“  ”]}], [{text: [“  ”]},{text: [“##”]}] ];

The editor showed an error:

"SyntaxError: Unexpected token ILLEGAL"

What's wrong? Why can't I create an array like this?

Upvotes: 1

Views: 37

Answers (1)

gurvinder372
gurvinder372

Reputation: 68413

replace with " (double quotes)

this is correct version of your array

var a = [ [{text: ["##"]},{text: ["  "]}], [{text: ["  "]},{text: ["##"]}] ]

Upvotes: 3

Related Questions