test1 returns true/false: let re1 = new RegExp("abc"); let re2 = /abc/; console.log(re1.test("abc")) // true console.log(re1.test("acd")) // false console.log(/abc/.test("abcde")) // true console.log(/abc/.test("abxde")) // false Footnotes Footnotes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test ↩