How do I remove an array item in TypeScript?

Source:https://stackoverflow.com/questions/15292278/how-do-i-remove-an-array-item-in-typescript

down vote
With ES6 you can use this code :
removeDocument(doc){
   this.documents.forEach( (item, index) => {
     if(item === doc) this.documents.splice(index,1);
   });
}

Không có nhận xét nào:

SO SÁNH 5 “ĐỨA CON AI” HOT NHẤT 2025

 https://www.facebook.com/AInews2023/posts/pfbid031usNyqqvstcDbFaRptkJmG3ReiTUUmGxGE5fp5PqPKqaseVRqVsoypKNS5CBRzNJl?__cft__[0]=AZUVx56Rvbt3n...