artdaq_node_server  v1_00_08
 All Classes Namespaces Files Variables Pages
lastIndexOf.js
1 var baseFindIndex = require('./_baseFindIndex'),
2  baseIsNaN = require('./_baseIsNaN'),
3  strictLastIndexOf = require('./_strictLastIndexOf'),
4  toInteger = require('./toInteger');
5 
6 /* Built-in method references for those with the same name as other `lodash` methods. */
7 var nativeMax = Math.max,
8  nativeMin = Math.min;
9 
31 function lastIndexOf(array, value, fromIndex) {
32  var length = array == null ? 0 : array.length;
33  if (!length) {
34  return -1;
35  }
36  var index = length;
37  if (fromIndex !== undefined) {
38  index = toInteger(fromIndex);
39  index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
40  }
41  return value === value
42  ? strictLastIndexOf(array, value, index)
43  : baseFindIndex(array, baseIsNaN, index, true);
44 }
45 
46 module.exports = lastIndexOf;