We have a list of books in the books object.How do we remove a single book from it, given that we know its ID?We can do books.removeById(42).Alternatively, we can find it with books.findById(42) and then call b.remove().Which option should we prefer, and why?The second choice is the better one.Not only because it���s more object-oriented, but also due to several practical advantages.
[image error]8 Femmes (2002) by Fran��ois OzonExtending the Deletion Behavior
What if we want to extend the deleti...
Published on June 21, 2025 17:00