Jump to content

How do you define a JavaScript array where all items are of a given object type.


OdedM

Recommended Posts

On 9/27/2005 at 12:53 PM, kaijim said:

Before you ask a question in this forum, you should check out our JavaScript Tutorial.For our JavaScript Tutorial: W3Schools JavaScript TutorialFor a complete JavaScript reference: W3Schools JavaScript ReferenceIf the object you are looking for is not in the reference, it may be in the HTML DOM reference: W3Schools HTML DOM Reference

  

On 9/27/2005 at 12:53 PM, kaijim said:

Before you ask a question in this forum, you should check out our JavaScript Tutorial.For our JavaScript Tutorial: W3Schools JavaScript TutorialFor a complete JavaScript reference: W3Schools JavaScript ReferenceIf the object you are looking for is not in the reference, it may be in the HTML DOM reference: W3Schools HTML DOM Reference

Hello.

How do you define a JavaScript array where all items are of a given object type.

e.g.

I need to define an object which includes among other things an array of objects named "series".

This "series" objects includes among other properties an array named instance whos items are objects of type {date: "", mode:""}.

The following definition is a reduced  version of the object. The problem with this definition is that it defines only items of index [0]

var tM = {series:
           [{instance:
               [{date:"",mode:""}
               ]
            }
          ]
         }

I looked for guidelines in all three references above

Thanks

Oded

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...