String includes vs RegExp.prototype.test

Edit on GitHub

Setup

Tests

  • String includes

    '123'.includes('1');
  • RegExp.prototype.test

    new RegExp('1').test('123');