indexOf vs includes

Edit on GitHub

Setup

Tests

  • indexOf

    var test = ["werenr", "uwe", "linus", "david"];
    test.indexOf("uwe");
    test.indexOf("werner");
  • includes

    var test = ["werenr", "uwe", "linus", "david"];
    test.includes("uwe");
    test.includes("werner");