isSameNativeClass

Test if two arguments have the same native class.

Usage

var isSameNativeClass = require( '@stdlib/assert/is-same-native-class' );

isSameNativeClass( a, b )

Tests if two arguments a and b have the same native class.

var bool = isSameNativeClass( 'beep', 'boop' );
// returns true

bool = isSameNativeClass( [], {} );
// returns false

Examples

var isSameNativeClass = require( '@stdlib/assert/is-same-native-class' );

var bool = isSameNativeClass( 3.14, new Number( 3.14 ) );
// returns true

bool = isSameNativeClass( 'beep', 'boop' );
// returns true

bool = isSameNativeClass( new TypeError( 'beep' ), new RangeError( 'boop' ) );
// returns true

bool = isSameNativeClass( [], {} );
// returns false

bool = isSameNativeClass( null, void 0 );
// returns false
Did you find this page helpful?