1let kossher = [ {player1:"kir"},{player2:"kos"},{player3:"kir"} ]
2
3let tirisaam = {}
4
5kossher.forEach((obj)=>{
6 Object.getOwnPropertyNames(obj).forEach((propertyName)=>{ // getOwnPropertyNames : returns list of property names and i did a foreach on it.
7 tirisaam[propertyName] = obj[propertyName]
8 })
9})
10
11console.log(tirisaam) //Object { player1: "kir", player2: "kos", player3: "kir" }
12