Search for a specified value within an array, and return its index (or -1 if not found)
@param   {*} value       The value to search for
@param   {Array} array   The array to search
@returns {int}           The index of value in array or -1 if not found
492221
function (value, array) {
            if (util.isFn(array.indexOf)) {
                return array.indexOf(value);
            } else {
                return $.inArray(value, array);
            }
        }
78092
public static int lastIndexOf(short[] array, short value) {
		if (null != array) {
			for (int i = array.length - 1; i >= 0; i--) {
				if (value == array[i]) {
					return i;
				}
			}
		}
		return INDEX_NOT_FOUND;
	}
173738
function removeFromArray(array, value) {
    var idx = array.indexOf(value);
    if (idx !== -1) {
      array.splice(idx, 1);
    }
    return array;
  }
339888
function (objectArray, id) {
                var i,
                    index = -1;
                for (i = 0; i < objectArray.length; i++) {
                    if (objectArray[i].id === id) {
                        index = i;
                        break;
                    }
                }

                return index;
            }
506230
function indexOf($value) {
        $i = 0;
        
        foreach($this->data as $val) {
            if($val === $value) {
                return $i;
            }
            
            $i++;
        }
        
        return null;
    }
469364
function inArray(value, arr) {
    let len = arr.length;
    for (let i = 0; i < len; i++) {
        if (arr[i] == value) {
            return true;
        }
    }
    return false;
}
1293483
function findIndex (array, predicate) {
  for (let i = 0; i < array.length; i++) {
    if (predicate(array[i])) return i
  }
  return -1
}
1117279
function arrayHasValue(arr, value) {
        var idx = arr.indexOf(value);
        if (idx !== -1) {
            return true;
        }
        return false;
    }
253419
public static int find(Object[] array, Object object) {

        for (int i = 0; i < array.length; i++) {
            if (array[i] == object) {

                // hadles both nulls
                return i;
            }

            if (object != null && object.equals(array[i])) {
                return i;
            }
        }

        return -1;
    }
869924
function next(array, item) {
  if (array && array.length && item) {
    const idx = array.indexOf(item);
    return idx === -1 ? null : array[idx + 1];
  }
  return null;
}
958383
function contains(array, value) {
  for (let i = 0; i < array.length; i++) {
    if (array[i] == value) { // non-strict equality check!
      return true;
    }
  }
  return false;
}
160005
function does (value) {
  var arrayIndexOf = (Array.indexOf ? function (arr, obj, from) {
    return arr.indexOf(obj, from)
  } : function (arr, obj, from) {
    var l = arr.length
    var i = from ? parseInt((1 * from) + (from < 0 ? l : 0), 10) : 0
    i = i < 0 ? 0 : i
    for (; i < l; i++) if (i in arr && arr[i] === obj) return i
    return -1
  })

  return {
    startWith: function (string) {
      if (is(value).a(String)) return value.slice(0, string.length) === string
      if (is(value).a(Array)) return value[0] === string
      return false
    },

    endWith: function (string) {
      if (is(value).a(String)) return value.slice(-string.length) === string
      if (is(value).a(Array)) return value[value.length - 1] === string
      return false
    },

    contain: function (field) {
      if (is(value).a(String)) return value.indexOf(field) > -1
      if (is(value).a(Object)) return Object.prototype.hasOwnProperty.call(value, field)
      if (is(value).a(Array)) return !!~arrayIndexOf(value, field)
      return false
    }
  }
}
1022840
function indexOf(arr, value, start) {
  start = start || 0;
  if (arr == null) {
    return -1;
  }
  var len = arr.length;
  var i = start < 0 ? len + start : start;
  while (i < len) {
    if (arr[i] === value) {
      return i;
    }
    i++;
  }
  return -1;
}
1372416
function(value){
            for(var i = this.targets.length - 1; i >= 0; i--){
                var target = this.targets[i];
                if(target.value === value){
                    return target;
                }
            }
        }
863207
function find(array, fn) {
    if (!(0, _is.isArray)(array)) {
        throw new Error('array should be Array type but got ' + (0, _is.whatIs)(array));
    }
    if ((0, _changlinWarning.warning)(!(0, _is.isFunction)(fn), 'fn is not function ,\'find\' will return undefined')) {
        return undefined;
    }

    if (array.find) {
        return array.find(fn);
    }

    var result = void 0;

    try {
        for (var i = 0; i < array.length; i++) {
            if (fn(array[i])) {
                result = array[i];
                break;
            }
        }
    } catch (e) {
        (0, _changlinWarning.warning)(true, e);
    }

    return result;
}
180053
public static <T> int indexOf(T[] array, T value) {
        for (int i = 0; i < array.length; i++) {
            if (array[i] == null) {
                if (value == null) return i;
            } else {
                if (value != null && array[i].equals(value)) return i;
            }
        }
        return -1;
    }
388417
function findIndex (array, item) {
  return array
    .map(function (i) {
      return i.toLowerCase()
    })
    .indexOf(item.toLowerCase())
}