time-to-botec/squiggle/node_modules/@stdlib/assert/is-native-function
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isNativeFunction

Test if a value is a native function.

Native functions execute native code that is typically not written in JavaScript, but a lower-level language like C++. This includes the JavaScript built-in functions, functions implemented using Node.js C/C++ addons, and code compiled via WebAssembly.

Usage

var isNativeFunction = require( '@stdlib/assert/is-native-function' );

isNativeFunction( value )

Tests if a value is a native function.

var bool = isNativeFunction( Date );
// returns true

function beep() {
    console.log( 'beep' );
}

bool = isNativeFunction( beep );
// returns false

Examples

var isNativeFunction = require( '@stdlib/assert/is-native-function' );

var bool = isNativeFunction( Math.sqrt );
// returns true

bool = isNativeFunction( Date );
// returns true

bool = isNativeFunction( RegExp );
// returns true

bool = isNativeFunction( function foo() {} );
// returns false

bool = isNativeFunction( 'beep' );
// returns false

bool = isNativeFunction( 5 );
// returns false

bool = isNativeFunction( true );
// returns false

bool = isNativeFunction( null );
// returns false

bool = isNativeFunction( [] );
// returns false

bool = isNativeFunction( {} );
// returns false