getting last element from the array code example
Example: get last element of array javascript
let colors = ["red", "yellow", "green"];
let lastELement = colors[colors.length - 1]
let colors = ["red", "yellow", "green"];
let lastELement = colors[colors.length - 1]