How do I add button values when the buttons have an array of values?

The earlier variables for cMount and dMount are defined so that they can be changed and updated.

let cMount = zeroValues;
let dMount = zeroValues;

When you used var cMount in the function, you created a new and unrelated cMount variable inside that function, the clobbered that original variable further up.

1 Like