input value
string value indicating a specification defined classification of the input value
var str = nativeClass( 'a' );
// returns '[object String]'
var str = nativeClass( 5 );
// returns '[object Number]'
function Beep() {
return this;
}
var str = nativeClass( new Beep() );
// returns '[object Object]'
Returns a string value indicating a specification defined classification (via the internal property
[[Class]]
) of an object.Notes
Symbol.toStringTag
allows overriding the default description of an object. While measures are taken to uncover the default description, such measures can be thwarted. While this function remains useful for type-checking, be aware that value impersonation is possible. Where possible, prefer functions tailored to checking for particular value types, as specialized functions are better equipped to addressSymbol.toStringTag
.