Hapus dua elemen terakhir array javascript
var arr = ['1','2','3','4'];
var amount_to_remove = 2;
arr.splice(arr.length - amount_to_remove, amount_to_remove); //['3', '4']
Thyago Mac