Sha256: 5539997ee146f43ebd1cbdf3016040dc2970bb9335eafae7be550cfb1e0b2341

Contents?: true

Size: 657 Bytes

Versions: 174

Compression:

Stored size: 657 Bytes

Contents

/**
 * Gets the index at which the first occurrence of `NaN` is found in `array`.
 *
 * @private
 * @param {Array} array The array to search.
 * @param {number} fromIndex The index to search from.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {number} Returns the index of the matched `NaN`, else `-1`.
 */
function indexOfNaN(array, fromIndex, fromRight) {
  var length = array.length,
      index = fromIndex + (fromRight ? 0 : -1);

  while ((fromRight ? index-- : ++index < length)) {
    var other = array[index];
    if (other !== other) {
      return index;
    }
  }
  return -1;
}

module.exports = indexOfNaN;

Version data entries

174 entries across 80 versions & 8 rubygems

Version Path
trusty-festivity-extension-2.3.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.3.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.3.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.3.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.3.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.3.0 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.3.0 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
gulp_assets-1.0.0.pre.5 template/node_modules/lodash/internal/indexOfNaN.js
gulp_assets-1.0.0.pre.4 template/node_modules/lodash/internal/indexOfNaN.js
gulp_assets-1.0.0.pre.3 template/node_modules/lodash/internal/indexOfNaN.js