MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / takeRight

Function takeRight

lib/web/jshint.js:6994–7004  ·  view source on GitHub ↗

* Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as a callback fo

(array, n, guard)

Source from the content-addressed store, hash-verified

6992 * // => []
6993 */
6994 function takeRight(array, n, guard) {
6995 var length = array ? array.length : 0;
6996 if (!length) {
6997 return [];
6998 }
6999 if (guard ? isIterateeCall(array, n, guard) : n == null) {
7000 n = 1;
7001 }
7002 n = length - (+n || 0);
7003 return baseSlice(array, n < 0 ? 0 : n);
7004 }
7005
7006 /**
7007 * Creates a slice of `array` with elements taken from the end. Elements are

Callers

nothing calls this directly

Calls 2

isIterateeCallFunction · 0.85
baseSliceFunction · 0.85

Tested by

no test coverage detected