Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/common-keys/docs/types/index.d"

Index

Functions

Functions

Export assignment commonKeys

  • commonKeys(obj1: any, obj2: any, ...obj: Array<any>): Array<string>
  • Returns the common own property names of two or more objects.

    Parameters

    • obj1: any

      first object

    • obj2: any

      second object

    • Rest ...obj: Array<any>

      additional objects

    Returns Array < string >

    common keys of objects

    Example

    var obj = {
        'a': 1,
        'b': 2,
        'c': 3
    };
    
    var obj2 = {
        'a': 1,
        'b': 2
    };
    
    var keys = commonKeys( obj, obj2 );
    // returns [ 'a', 'b' ]

    Example

    var obj1 = {
        'a': 1,
        'b': 2,
        'c': 3
    };
    
    var obj2 = {
        'a': 1,
        'b': 2
    };
    
    var obj3 = {
        'a': 1,
    };
    
    var keys = commonKeys( obj1, obj2, obj3 );
    // returns [ 'a' ]