Visit Mozilla.org

Sandbox:JS:String.prototype.constructor

From MDC


A reference to the String constructor.

All objects have a constructor property, so testing this property against a constructor is an alternative to using the typeof operator:

var str = 'JavaScript';
str.constructor == String // true
typeof str == 'string'    // true