Answers for "print the last element of the array javascript"

0

javascript get last element of array

let arry = [2, 4, 6, 8, 10, 12, 14, 16];
let lastElement = arry[arry.length - 1];

console.log(lastElement);

//Output: 16
Posted by: Guest on September-29-2021

Code answers related to "print the last element of the array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language