javascript - Return Multidimensional Array -


i want return multiply dimensional array function must writing wrong, cant figure out whats wrong. want have key , value pairs.

function multidimensional(){      return [          "one": [             "two":[],             "three":[                 "testing.png":{source:"http..."}             ],         "another.png": {source:"http..."}     ]; }  

if want have key/value pairs, should use an object.

function multidimensional(){      return {          "one": {             "two":[],             "three":{                 "testing.png":{source:"http..."}             },         "another.png": {source:"http..."}     }; }  

you can access returned data so:

var data = multidimensional(); console.log(data['another.png']); // or console.log(data.one); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -