how to test if a string is a string in javascript code example Example: js test if string if (typeof string === 'string') { /* code */ };