MCPcopy
hub / github.com/lodash/lodash / drop

Function drop

lodash.js:7142–7149  ·  view source on GitHub ↗

* Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard]

(array, n, guard)

Source from the content-addressed store, hash-verified

7140 * // => [1, 2, 3]
7141 */
7142 function drop(array, n, guard) {
7143 var length = array == null ? 0 : array.length;
7144 if (!length) {
7145 return [];
7146 }
7147 n = (guard || n === undefined) ? 1 : toInteger(n);
7148 return baseSlice(array, n < 0 ? 0 : n, length);
7149 }
7150
7151 /**
7152 * Creates a slice of `array` with `n` elements dropped from the end.

Callers

nothing calls this directly

Calls 2

toIntegerFunction · 0.85
baseSliceFunction · 0.85

Tested by

no test coverage detected