I have the following snippet of code which intends to update the value of the array "end" each time the if statement evaluates as true(in this case it equals to three). However, the array just gets superseded by the last update and all previous values are deleted. How can it be appended with the new set of values?
d.forEach(function (d) {
if (d.state_type=="end") {
end=d.user_ids;
}
});