check if a word contains different character javascript code example
Example 1: if string javascript
if (typeof myVar === 'string') { /* code */ };
Example 2: javascript includes
const pets = ['cat', 'dog', 'bat'];
console.log(pets.includes('cat'));
// output: true