js set .delete last index code example
Example 1: splice last element from array javascript
array.splice(-1,1)
Example 2: remove from set javascript
// Create new set
const animals = new Set();
// Add to set
animals.add('cat');
animals.add('dog');
// Remove from set
animals.delete('cat'); // returns true
animals.delete('dog'); // returns true
animals.delete('horse'); // returns false