check if string contains specific text javascript code example Example: if string javascript if (typeof myVar === 'string') { /* code */ };