In a javascript array, how do I get the last 5 elements, excluding the first element? - Stack Overflow

PHOTO EMBED

Thu Aug 13 2020 01:22:41 GMT+0000 (Coordinated Universal Time)

Saved by @rdemo #javascript

arr.slice(Math.max(arr.length - 5, 0))
content_copyCOPY

https://stackoverflow.com/questions/6473858/in-a-javascript-array-how-do-i-get-the-last-5-elements-excluding-the-first-ele