I want to add more elements dynamically to an array that has a named structure, I have (this works):
var v = [{
x: 0,
y: 0
}];
It initializes the structure with 1 element with 2 values, but, I want to add more elements later in the page, something like:
v.x.push(2); // something like this would insert a new element and give value of 2 to x of the new element.
Can anyone help me with this, using pure JavaScript? Thanks.