why is my javascript array getting overridden?

I have couple of text inputs in a single page ReactJS app, the value of which is passed up to the parent component.
My function is supposed to make the two inputs values into an object, which is then pushed onto an array.

When my function is ran on button click, my array seems to be overridden by the latest entry from the inputs.

function addToArray() {obj = {name: currName, age: currAge};objectArray.push(obj);for(let i=0;i<objectArray.length;i++){console.log(objectArray[i]);}}

Both the array and object are initialised when the app starts. The function is only ran by a button press and nothing else so i cant see how its being overridden.