check if var is string javas code example Example: js test if string if (typeof string === 'string') { /* code */ };