obj === fixed vs Array.prototype.includes

Edit on GitHub

Setup

var myInt = 5;
var myString = 'string';
var ints = [1, 2, 5, 6];
var strings = ['my', 'string', 'is', 'here'];

Tests

  • obj === fixed

    myInt === 5;
    myString === 'string';
  • Array.prototype.includes

    ints.includes(myInt);
    strings.includes(myString);