array-last
array-last copied to clipboard
what if second_params is greater than first_params.lenth?
you took independent action for scene -- n === 1, but another scene like n > arr.length , like arr.length == 1,
and its necessary to use another tool like is_number?
n = isNumber(n) ? +n :1; => n = typeof n == 'number' ? +n : 1;
add
if (n >= len || len == 1){ return arr }