javascript – how I can add new key value pairs and how to loop it to get each values?

In my react app I have a array state

state={
    relationData: ()
}

I want to push data that has a key-value pair

Example(expected array)

( {name:"Amit",id:1}, {name:"Pankaj",id:2}, {name:"Sumit",id:3} )

Above structure, I want after push data So how I can push this name and id?

Also, I want to loop this array such as I can print the name and its id. How I can do these two tasks?