Sha256: b732faa8661828155c24d3953afec6c0f345764eabfeeef874c52add8eeff1e0

Contents?: true

Size: 491 Bytes

Versions: 25

Compression:

Stored size: 491 Bytes

Contents

var isIndex = require('./_isIndex');

/**
 * The base implementation of `_.nth` which doesn't coerce `n` to an integer.
 *
 * @private
 * @param {Array} array The array to query.
 * @param {number} n The index of the element to return.
 * @returns {*} Returns the nth element of `array`.
 */
function baseNth(array, n) {
  var length = array.length;
  if (!length) {
    return;
  }
  n += n < 0 ? length : 0;
  return isIndex(n, length) ? array[n] : undefined;
}

module.exports = baseNth;

Version data entries

25 entries across 4 versions & 2 rubygems

Version Path
babel-schmooze-sprockets-0.1.3 node_modules/lodash/_baseNth.js
blackboard-3.1.9 lib/site_template/node_modules/sass-graph/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.2 node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-define-map/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-function-name/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-get-function-arity/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-hoist-variables/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-optimise-call-expression/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-regex/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-replace-supers/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-classes/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-core/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-function-name/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-modules-commonjs/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-parameters/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-shorthand-properties/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-sticky-regex/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-regenerator/node_modules/lodash/_baseNth.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-strict-mode/node_modules/lodash/_baseNth.js