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