Answer the question
In order to leave comments, you need to log in
How to create a two dimensional js array?
Hello! How to create a two dimensional array in js?
Tried to do like this:
var modelInfo['title']['color'] = 'qq';
console.log(var modelInfo['title']['color']);
Uncaught SyntaxError: Unexpected token [
var modelInfo['1']['color'] = 'blue';
var modelInfo['1']['inch'] = '72';
var modelInfo['1']['price'] = '1500';
var modelInfo['2']['color'] = 'red';
var modelInfo['2']['inch'] = '35';
var modelInfo['2']['price'] = '800';
Answer the question
In order to leave comments, you need to log in
{
"1": {
"color": 1,
"title": "asd"
},
"2": {
"color": 1,
"title": "asd"
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question