Answers for "last() in javascript"

1

last element from list javascript

const lastItem = colors[colors.length - 1]
Posted by: Guest on June-19-2020
-1

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']
Posted by: Guest on October-04-2020

Code answers related to "last() in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language