Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get the last array element

const myArray = [1, 2, 3]

console.log(myArray.item(-1))
//=> 3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #array #element
ADD COMMENT
Topic
Name
1+3 =