typescript update item in array code example
Example: replace element in array typescript
const index: number = items.indexOf(element);
if (index !== -1) {
items[index] = newElement;
}
const index: number = items.indexOf(element);
if (index !== -1) {
items[index] = newElement;
}