let cord = [{x: 0, y: 0, type: 5, active: true}]
console.log(cord)
//x=5
cord.map(elem => elem.x = 5)
console.log(cord)
//x=5
function incrementX(obj) {
obj.x += 1
return obj
}
var a = {x: 0}
var b = incrementX(a)
console.log(b) // {x: 1}
console.log(a) // {x: 1} -- Магия