Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Whatever
array cut only last 5 element
curi0us s0ul
Programming language:
Whatever
2021-07-28 13:10:26
0
Q:
array cut only last 5 element
Sagar Gupta
Code:
Whatever
2021-08-28 22:42:38
arr.slice(Math.max(arr.length - 5, 0))
0
Tags
array
element
last
New to Communities?
Join the community