Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-method/docs/types/index.d"

Index

Functions

Functions

Export assignment isMethod

  • isMethod(value: any, property: any): boolean
  • Tests if an object has a specified method name.

    Notes

    • Value arguments other than null or undefined are coerced to objects.
    • Property arguments are coerced to strings.
    • The function only searches own properties.

    Parameters

    • value: any

      value to test

    • property: any

      property to test

    Returns boolean

    boolean indicating if an object has a specified method name

    Example

    var beep = {
        'boop': isMethod
    };
    
    var bool = isMethod( beep, 'boop' );
    // returns true
    
    var bool = isMethod( beep, 'toString' );
    // returns false