73
rated 0 times
[
75]
[
2]
/ answers: 1 / hits: 74351
/ 7 Years ago, tue, june 13, 2017, 12:00:00
I have an array containing objects in javascript / typescript.
let array = [{id:1,name:'One'}, {id:2, name:'Two'}, {id:3, name: 'Three'}]
How can I update name of the second element (with id 2) and copy the array to a new array using javascript spread (...) operator?
More From » typescript