how to get the last element of integer in javascript code example
Example: javascript array last element
var lastEle = arr.slice(-1)[0];
// or
var lastEle = arr.slice(-1).pop();
var lastEle = arr.slice(-1)[0];
// or
var lastEle = arr.slice(-1).pop();