How to remove the last item from the array in JavaScript

1 Answer

0 votes
let arr = [1, 2, 3, 4, 5, 6, 7];
 
arr.pop();

console.log(arr);


    
    
/*
run:
    
[1, 2, 3, 4, 5, 6]
    
*/

 



answered Jun 11, 2021 by avibootz
...