ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## slice + [link](./slice "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6423 "View in source.") + [npm](https://www.npmjs.com/package/lodash.slice "See the npm package.") ``` _.slice(array, [start=0], [end=array.length]) ``` 创建一个裁剪后的数组,从 start 到 end 的位置,但不包括 end 本身的位置。 **注意:** 这个方法用于代替 [`Array#slice`](https://mdn.io/Array/slice) 来确保数组正确返回 ### 参数 1. array (Array) 需要裁剪的数组 2. [start=0] (number) 开始位置 3. [end=array.length] (number) 结束位置 ### 返回值 (Array) 返回裁剪后的数组