Answers for "javascript string.test"

5

js test if string

if (typeof string === 'string') { /* code */ };
Posted by: Guest on April-18-2020
19

javascript regex .test

const str = 'hello world!';
const result = /^hello/.test(str);

console.log(result); // true

/**
The test() method executes a search for a match between 
a regular expression and a specified string
*/
Posted by: Guest on May-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language