Sha256: 1331b76731043e426bf8e1ba7b40542a9f8e92a74efbf052a98bd7e81430bf48

Contents?: true

Size: 871 Bytes

Versions: 153

Compression:

Stored size: 871 Bytes

Contents

var baseSlice = require('../internal/baseSlice'),
    isIterateeCall = require('../internal/isIterateeCall');

/**
 * Creates a slice of `array` from `start` up to, but not including, `end`.
 *
 * **Note:** This method is used instead of `Array#slice` to support node
 * lists in IE < 9 and to ensure dense arrays are returned.
 *
 * @static
 * @memberOf _
 * @category Array
 * @param {Array} array The array to slice.
 * @param {number} [start=0] The start position.
 * @param {number} [end=array.length] The end position.
 * @returns {Array} Returns the slice of `array`.
 */
function slice(array, start, end) {
  var length = array ? array.length : 0;
  if (!length) {
    return [];
  }
  if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
    start = 0;
    end = length;
  }
  return baseSlice(array, start, end);
}

module.exports = slice;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
ilog-0.4.1 node_modules/contents/node_modules/lodash/array/slice.js
ilog-0.4.1 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/array/slice.js
ilog-0.4.1 node_modules/babel/node_modules/lodash/array/slice.js
ilog-0.4.0 node_modules/babel/node_modules/lodash/array/slice.js
ilog-0.4.0 node_modules/contents/node_modules/lodash/array/slice.js
ilog-0.4.0 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/array/slice.js
ilog-0.3.3 node_modules/babel/node_modules/lodash/array/slice.js
ilog-0.3.3 node_modules/contents/node_modules/lodash/array/slice.js
ilog-0.3.3 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/inquirer/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/array/slice.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/inquirer/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/inquirer/node_modules/lodash/array/slice.js