angular delete from array by name

JavaScript
this.data = this.data.filter(item => item !== data_item);deleteMsg(msg:string) {
    const index: number = this.data.indexOf(msg);
    if (index !== -1) {
        this.data.splice(index, 1);
    }        
}
Source

Also in JavaScript: