# All files / src/utils index-of.js

40% Statements 4/10
25% Branches 1/4
100% Functions 1/1
50% Lines 3/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    1018x

    18x
    3x

     var indexOf = [].indexOf

    module.exports = function(arr, obj){
      Eif (indexOf) return arr.indexOf(obj);
      for (var i = 0, il = arr.length; i < il; ++i) {
        if (arr[i] === obj) return i;
      }
      return -1
    }