Returns a boolean value that indicates whether or not a pattern exists in a searched string.
test(string)
string
String on which to perform the search.
true if there is a match between the regular expression and the string, false otherwise.
/[a-z]/.test('abc')
true
/[0-9]/.test('abc')
false