Answers for "frst and last element of array"

43

last element array

var my_array = /* some array here */;
var last_element = my_array[my_array.length - 1];
Posted by: Guest on March-14-2020
1

get the last element of array javascript

let array = [1, 2, 3, 4, 5]
array.at(-1) // last element on array (5)
Posted by: Guest on December-01-2021

Code answers related to "frst and last element of array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language