Wählen Sie die letzten 2 Indizes in JS aus
var array = [1,5,7,8,10,12,23,24];
console.log(array.slice(-2));
Run code snippet
crimbus
var array = [1,5,7,8,10,12,23,24];
console.log(array.slice(-2));
Run code snippet