I'm looking to modify the name of the second object in a javascript/typescript array. Here's my array:
let array = [{id:1,name:'One'}, {id:2, name:'Two'}, {id:3, name: 'Three'}]
Is there a way to update the name of the element with id 2 and then duplicate the array using the spread (...) operator in JavaScript?