Answers for "typecript remove nil element from array"

2

Remove single item from array in angular

deleteMsg(msg:string) {
    const index: number = this.data.indexOf(msg);
    if (index !== -1) {
        this.data.splice(index, 1);
    }        
}
Posted by: Guest on May-25-2020
5

typescript remove an item from array

myArray.splice(index, 1); // insert index and then amount to remove 
						  // from that index
Posted by: Guest on October-27-2020

Code answers related to "typecript remove nil element from array"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language