0

I need to declare and insert elements in this type of structure which is required by the web service. So the input of my service like this:

data["A"]["12"]="word" (data)["String"]["String"]=(String)

i dont know if this called (HashList or MapList) I think it's not a Multi dimensional array becore is not indexed by 0,1....n How can i declare this type of structure?

1 Answer 1

4

That's just an object:

var data = {
    A: {
        '12': 'word'
    }
}

Properties of JavaScript objects can be accessed or set using a bracket notation, just as in your example.

Working with Objects

Sign up to request clarification or add additional context in comments.

3 Comments

you have a typo. should be data = {
@t.niese: 10x, I fixed it.
Thinks a lot for declaration , how can i fill it with data ? if it is an example it would be great ?

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.