Is there a way to define array size inside objects in Java Script? Like we do in C or C++, when we want user to enter values in array, we define a size and populate it using indexes according to user. Display is done using something like n[4] (assuming n is an array.)
function activity(id, name, description, prior, post, start, end, current, status) {
this.id = id; //activity id
this.name = name; //activity name
this.description = description; //activity description
**this.prior = prior[]; // prior activities
this.post = post[]; //post activities**
this.start = start; //activity start date
this.end = end; //activity end date
this.currentWork = currentWork; //current work that has been done
this.status = status; //current status
}
I want prior and post to be arrays of size 3. I am making 18 instances of above object, each one with different value. Tell me how to access these values how to enter values in this array?