check if a character not in a string js 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