RegExp.prototype.exec vs RegExp.prototype.test

Edit on GitHub

Setup

Tests

  • RegExp.prototype.exec

    /o/.exec('Hello World');
  • RegExp.prototype.test

    /o/.test('Hello World');