Notice
Recent Posts
Recent Comments
Link
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Tags
more
Archives
Today
Total
관리 메뉴

Mini

[Nest JS] 없는 게시물 지울때 예외처리 본문

JS/Nest.js

[Nest JS] 없는 게시물 지울때 예외처리

Mini_96 2024. 8. 17. 20:57
deleteBoard(id:string):void{
  const found = this.getBoardByID(id);
  //filter => 해당 id제외 해서 새로운 boards를 만듬
  this.boards = this.boards.filter((board) => board.id !== found.id);
}