Class Support

Detect native class support.

Usage

var hasClassSupport = require( '@stdlib/utils/detect-class-support' );

hasClassSupport()

Detects if a runtime environment supports ES2015 class.

var bool = hasClassSupport();
// returns <boolean>

Notes

  • The implementation uses code evaluation, which may be problematic in browser contexts enforcing a strict content security policy (CSP).

Examples

var hasClassSupport = require( '@stdlib/utils/detect-class-support' );

var bool = hasClassSupport();
if ( bool ) {
    console.log( 'Environment has native class support.' );
} else {
    console.log( 'Environment lacks native class support.' );
}

CLI

Usage

Usage: hasclass [options]

Options:

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

Examples

$ hasclass
<boolean>