js array remove item All In One_removejs array remove item All In One



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"]


js array remove item All In One_remove


const months = ['Jan', 'March', 'April', 'June'];

// remove last one item
months.pop();
// "June"

console.log(months);
// ["Jan", "March", "April"]


js array remove item All In One_js_03