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
ilog-0.4.1 node_modules/contents/node_modules/lodash/internal/indexOfNaN.js
ilog-0.4.1 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/internal/indexOfNaN.js
ilog-0.4.1 node_modules/babel/node_modules/lodash/internal/indexOfNaN.js
ilog-0.4.0 node_modules/babel/node_modules/lodash/internal/indexOfNaN.js
ilog-0.4.0 node_modules/contents/node_modules/lodash/internal/indexOfNaN.js
ilog-0.4.0 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/internal/indexOfNaN.js
ilog-0.3.3 node_modules/babel/node_modules/lodash/internal/indexOfNaN.js
ilog-0.3.3 node_modules/contents/node_modules/lodash/internal/indexOfNaN.js
ilog-0.3.3 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js