You can't change a Javascript operator, however you can check if it's a string OR a string object with instanceof
.
var strObj = new String('im a string')
var str = 'im a string'
alert(strObj instanceof String); //true
alert(typeof strObj == 'string'); //false
alert(str instanceof String); //false
alert(typeof str == 'string'); //true
alert(strObj instanceof String || typeof strObj == 'string'); //true
alert(str instanceof String || typeof str == 'string'); //true
Of course, it is much more simple and shorter to create your own function, but if you want to use native JS, that is the way : alert(str instanceof String || typeof str == 'string');
.