js array remove item All In One
const months = ['Jan', 'March', 'April', 'June'];
// remove last one item
months.splice(months.length - 1, 1);
// ["June"]
console.log(months);
// ["Jan", "March", "April"]
const months = ['Jan', 'March', 'April', 'June'];
// remove last one item
months.pop();
// "June"
console.log(months);
// ["Jan", "March", "April"]