I’ve been working with some arrays in javascript. I’ve got a parse error at this line:
var cardData[0] = [
[
'Rumble Pack',
'Robert Mugabe',
0.2,
0.7,
21,
RuleTypes.dictatorship,
'88%',
'45%',
'\'The Jewel of Africa\', Zimbabwe, returning to the stone age. R.M. let a rabble led by Chenjerai \'Hitler\' Hunzwi murder white farmers at will. 25 % of Zimbabwians HIV-positive. Life expectancy fallen 16 yrs. under R.M.'
]
];
Remember that the line is a single line, i don’t know if that makes any difference…
Can someone help me? 🙂 .
var cardData[0]doesn’t work like that. Do this instead:or more simply:
vardeclares a variable with a certain name, and bracket notation is not a valid in a variable name.