Can we specify array size within objects in Java Script? Similar to how it is done in C or C++, where a predetermined size is defined for an array and then populated using indexes. For example, displaying values like n[4] (assuming n is the 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 would like 'prior' and 'post' to be arrays of size 3. I am creating 18 instances of the above object, each with different values. Please advise on how to access and input values into these arrays.