Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array last element

var lastEle = arr.slice(-1)[0];
// or
var lastEle = arr.slice(-1).pop();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #array #element
ADD COMMENT
Topic
Name
1+3 =