choosing last value in array code example
Example: last item in array javascript
const array = ['a', 's', 'd', 'f'];
const last = array.pop();
console.log(last); // Returns 'f'
console.log(array); // Returns ['a', 's', 'd']
const array = ['a', 's', 'd', 'f'];
const last = array.pop();
console.log(last); // Returns 'f'
console.log(array); // Returns ['a', 's', 'd']