function hasWeakMapSupport() {
	var bool;
	var key;
	var wm;

	if ( typeof GlobalWeakMap !== 'function' ) {
		return false;
	}
	// Test basic support...
	try {
		key = {};
		wm = new GlobalWeakMap();
		wm.set( key, 'beep' );
		bool = (
			wm.has( key ) &&
			wm.get( key ) === 'beep'
		);
	} catch ( err ) { // eslint-disable-line no-unused-vars
		bool = false;
	}
	return bool;
}
Tests for native `WeakMap` support.

@returns {boolean} boolean indicating if an environment has `WeakMap` support

@example
var bool = hasWeakMapSupport();
// returns <boolean>