Sha256: 0066052b2f2b92b1e99825750740cab607ff55ea2d70c5a2541b26d414d92623

Contents?: true

Size: 1.06 KB

Versions: 273

Compression:

Stored size: 1.06 KB

Contents

var baseFill = require('./_baseFill'),
    isIterateeCall = require('./_isIterateeCall');

/**
 * Fills elements of `array` with `value` from `start` up to, but not
 * including, `end`.
 *
 * **Note:** This method mutates `array`.
 *
 * @static
 * @memberOf _
 * @since 3.2.0
 * @category Array
 * @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 position.
 * @returns {Array} Returns `array`.
 * @example
 *
 * var array = [1, 2, 3];
 *
 * _.fill(array, 'a');
 * console.log(array);
 * // => ['a', 'a', 'a']
 *
 * _.fill(Array(3), 2);
 * // => [2, 2, 2]
 *
 * _.fill([4, 6, 8, 10], '*', 1, 3);
 * // => [4, '*', '*', 10]
 */
function fill(array, value, start, end) {
  var length = array == null ? 0 : array.length;
  if (!length) {
    return [];
  }
  if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
    start = 0;
    end = length;
  }
  return baseFill(array, value, start, end);
}

module.exports = fill;

Version data entries

273 entries across 271 versions & 29 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/fill.js
immosquare-cleaner-0.1.59 node_modules/lodash/fill.js
immosquare-cleaner-0.1.58 node_modules/lodash/fill.js
immosquare-cleaner-0.1.57 node_modules/lodash/fill.js
immosquare-cleaner-0.1.56 node_modules/lodash/fill.js
immosquare-cleaner-0.1.55 node_modules/lodash/fill.js
immosquare-cleaner-0.1.54 node_modules/lodash/fill.js
immosquare-cleaner-0.1.53 node_modules/lodash/fill.js
immosquare-cleaner-0.1.52 node_modules/lodash/fill.js
trusty-cms-6.3.1 node_modules/lodash/fill.js
immosquare-cleaner-0.1.51 node_modules/lodash/fill.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/fill.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/fill.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/fill.js
immosquare-cleaner-0.1.50 node_modules/lodash/fill.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/fill.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/fill.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/fill.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/fill.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/fill.js