String.prototype.match vs String.prototype.indexOf

Edit on GitHub

Setup

Tests

  • String.prototype.match

    'Hello World'.match(/o/)
  • String.prototype.indexOf

    'Hello World'.indexOf('o') > -1