I'm new to frontend and my question is the following: I have a list of items and I want to remove the last item in some conditions. And it seems to me that there are two options: 1. assign the list with a class, so that I can identify the list by JS and get its child and remove. 2. assign those items with a class, so that I can target the item directly and remove. To me the drawback of 1 is we are not able get the item directly and the the drawback of 2 is we will assign class to too many element. I'm not able to find related best practice, can anyone point me what docs I should take a look or which one is better and why? Thanks