Remove element from end of array javascript-
To remove an element from the end of an array, you use the pop()
method:-
let seas = ['Black Sea', 'Caribbean Sea', 'North Sea', 'Baltic Sea'];
const lastElement = seas.pop();
console.log(lastElement);
Remove element from end of array javascript-
To remove an element from the end of an array, you use the pop()
method:-
let seas = ['Black Sea', 'Caribbean Sea', 'North Sea', 'Baltic Sea'];
const lastElement = seas.pop();
console.log(lastElement);