0 points

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


dashboard

Thu Aug 13 2020 01:22:41 GMT+0000 (UTC)

Posted by @rdemo #javascript

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

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