Index Of vs Include

Edit on GitHub

Setup

Tests

  • Index Of

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

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