diff --git a/slice.js b/slice.js index c137b7902..9c24d4dc1 100644 --- a/slice.js +++ b/slice.js @@ -11,6 +11,12 @@ * @param {number} [start=0] The start position. A negative index will be treated as an offset from the end. * @param {number} [end=array.length] The end position. A negative index will be treated as an offset from the end. * @returns {Array} Returns the slice of `array`. + * @example + * + * var array = [1, 2, 3, 4] + * + * _.slice(array, 2) + * // => [3, 4] */ function slice(array, start, end) { let length = array == null ? 0 : array.length