mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(util) slice: add count
This commit is contained in:
parent
2a24cbb64a
commit
f5db7a8a24
1 changed files with 2 additions and 5 deletions
|
|
@ -851,14 +851,11 @@
|
|||
*
|
||||
* @param array
|
||||
*/
|
||||
this.slice = function(array) {
|
||||
this.slice = function(array, count) {
|
||||
var ret;
|
||||
|
||||
array = arguments[0];
|
||||
[].shift.apply(arguments);
|
||||
|
||||
if (array)
|
||||
ret = [].slice.apply(array, arguments);
|
||||
ret = [].slice.apply(array, count);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue