1

I need a 3D array like a runes['red'][0]['test']

How I can do it?

    var runes = {}

runes['red'] = [
    'test': ['loh']
]
runes['blue'] = {}
runes['yellow'] = {}

Thanks in advance.

0

2 Answers 2

2

So you want an object containing an array with objects inside it? That would look like this:

runes["red"] = [
    {test: "loh"},
    {anotherTest: "anotherLoh"}
]
Sign up to request clarification or add additional context in comments.

Comments

2
var runes = {};        // Object

runes.red = [          // containing Array of Objects
  {'test': 'loh'},     // 0  
  {'test': 'blah'},    // 1
  {property1: "value", property2: "value"}  // 2...
];

alert( runes.red[0].test ); // loh

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.