javascript other ways to check if variable is string code example Example: js test if string if (typeof string === 'string') { /* code */ };