indexOf array vs includes array

Edit on GitHub

Setup

Tests

  • indexOf array

    let n = [1, 2, 5, 12];
    
    n.indexOf(5);
  • includes array

    let n = [1, 2, 5, 12];
    
    n.includes(5);