WeakMap Support

Detect native WeakMap support.

Usage

var hasWeakMapSupport = require( '@stdlib/utils/detect-weakmap-support' );

hasWeakMapSupport()

Detects if a runtime environment supports ES2015 WeakMap.

var bool = hasWeakMapSupport();
// returns <Boolean>

Examples

var hasWeakMapSupport = require( '@stdlib/utils/detect-weakmap-support' );

var bool = hasWeakMapSupport();
if ( bool ) {
    console.log( 'Environment has WeakMap support.' );
} else {
    console.log( 'Environment lacks WeakMap support.' );
}

CLI

Usage

Usage: hasweakmap [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ hasweakmap
<boolean>