Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript take last element of array

let array = [1,2,3,4,5];
let lastElement = array.pop();

// array -> [1,2,3,4];
// lastElement = 5;
Source by bobbyhadz.com #
 
PREVIOUS NEXT
Tagged: #javascript #element #array
ADD COMMENT
Topic
Name
7+7 =