RegExp.test

test — Use the regular expression as a match test.

Description

RegExp.test(string string)

Parameters

Name Description Type Default Optional
string string No

Return values

boolean primitive.

Examples

Example #1 – test example
console.log(/[a-z]+/.test('Hello World')); // true console.log(/[a-z]+/.test('FOO')); // false

External references