So basically my div generates like this:
<div class="test className">content</div>
<div class="test className">content</div>
<div class="test className">content</div>
..
<div class="test className">content</div>
and I’m trying to remove duplicated divs and keep last one only! any quick ideas? thanks!
A quick idea based on your provided markup.
But I would prevent duplication at first place.
edit: Here is another alternative using
filterandslicemethod:In the above snippet by using
-1as the second argument of the.slicemethod, the last element in the set is ignored.