Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript last in a list

let list = ["item1", "item2", "item3", "etc"];
let last = list.reverse()[0]
// or
let last = list[list.length - 1]
// or
let last = list.slice(-1)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #list
ADD COMMENT
Topic
Name
2+3 =