Returns a new array containing the last n elements of the input array.
A non-finite n (NaN or Infinity) is treated as 0, floats are
truncated, negative values are clamped to 0, and values greater than the
array length are clamped to the length.
从数组末尾截取最后 n 个元素。
返回一个新数组,包含输入数组的最后 n 个元素。非有限值 n(NaN 或 Infinity)按 0 处理,浮点数会被截断,负数按 0 处理,超过数组长度的值按数组长度处理。
Takes the last n elements of an array.
Returns a new array containing the last
nelements of the input array. A non-finiten(NaNorInfinity) is treated as0, floats are truncated, negative values are clamped to0, and values greater than the array length are clamped to the length.从数组末尾截取最后 n 个元素。
返回一个新数组,包含输入数组的最后
n个元素。非有限值n(NaN或Infinity)按0处理,浮点数会被截断,负数按0处理,超过数组长度的值按数组长度处理。