time-to-botec/js/node_modules/@stdlib/assert/is-arrow-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

isArrowFunction

Test if a value is an arrow function.

Usage

var isArrowFunction = require( '@stdlib/assert/is-arrow-function' );

isArrowFunction( value )

Tests if a value is a an arrow function such as ( a, b ) => a + b, x => x, or ( x ) => { return x*x; }.

var beep = () => {
    console.log( 'beep' );
};

var bool = isArrowFunction( beep );
// returns true

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

bool = isArrowFunction( boop );
// returns false

Examples

var isArrowFunction = require( '@stdlib/assert/is-arrow-function' );

var bool = isArrowFunction( () => {} );
// returns true

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

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

bool = isArrowFunction( 5 );
// returns false

bool = isArrowFunction( true );
// returns false

bool = isArrowFunction( null );
// returns false

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

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