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

Function baseFill

lib/web/jshint.js:3431–3449  ·  view source on GitHub ↗

* The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end p

(array, value, start, end)

Source from the content-addressed store, hash-verified

3429 * @returns {Array} Returns `array`.
3430 */
3431 function baseFill(array, value, start, end) {
3432 var length = array.length;
3433
3434 start = start == null ? 0 : (+start || 0);
3435 if (start < 0) {
3436 start = -start > length ? 0 : (length + start);
3437 }
3438 end = (end === undefined || end > length) ? length : (+end || 0);
3439 if (end < 0) {
3440 end += length;
3441 }
3442 length = start > end ? 0 : (end >>> 0);
3443 start >>>= 0;
3444
3445 while (start < length) {
3446 array[start++] = value;
3447 }
3448 return array;
3449 }
3450
3451 /**
3452 * The base implementation of `_.filter` without support for callback

Callers 1

fillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected