Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

replace element in array typescript

const index: number = items.indexOf(element);

if (index !== -1) {
    items[index] = newElement;
}
 
PREVIOUS NEXT
Tagged: #replace #element #array #typescript
ADD COMMENT
Topic
Name
5+9 =