last n items Select last n items from array #javascript#array // Number of items to select numberOfItems = 100; // Create a new array with last N items let selectedArray = originalArray.slice( Math.max( originalArray.length - numberOfItems, 1 ) ); copy