javascript match return boolean code example
Example: javascript boolean regex match
//RegExp.prototype.test()
str = 'ok';
regex = /ok/;
console.log(regex.test(str)) // => true
//RegExp.prototype.test()
str = 'ok';
regex = /ok/;
console.log(regex.test(str)) // => true