how do i cut the end number off an array in js? code example Example: array cut only last 5 element arr.slice(Math.max(arr.length - 5, 0))