Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS last element of array

const arr = [1,2,3,4,5]
arr.at(-1) //returns 5
 
PREVIOUS NEXT
Tagged: #JS #element #array
ADD COMMENT
Topic
Name
2+8 =