Sorry new to typescript, I have this array of object, i need to insert another property type with value Customer for all objects.
//this is printed out in browser's developer mode, that's why the index is there
0: {name: "Ken", address: "USA"}
1: {name: "Peter", address: "USA"}
In the final array, it will be:
0: {name: "Ken", address: "USA", type: "Customer"}
1: {name: "Peter", address: "USA", type: "Customer"}
Something like:
this.users.forEach(function (user) {
user.type: "Customer"
});
Tried to search around but not able to find the answer, how do i achieve the above?
:to=.