Jak sprawdzić ostatni element w tablicy JavaScript
const colors = ['red', 'yellow', 'green', 'blue']
const lastItem = colors[colors.length - 1]
console.log(lastItem)
deejay
const colors = ['red', 'yellow', 'green', 'blue']
const lastItem = colors[colors.length - 1]
console.log(lastItem)
.slice(-1)[0]
int [] y={1,2,3,4,5};
int c=(n.length-1);