const osArray = [
{id: 0, name: "Windows"},
{id: 1, name: "Linux"},
{id: 2, name: "MacOS"},
];

const updatedOSArray = osArray.map(p =>
p.id === 1
? { ...p, name: 'Ubuntu' }
: p
);

console.log("After update: ", updatedOSArray);