replace value in array typescript 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;
}