Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/pick/docs/types/index.d"

Index

Functions

Functions

Export assignment pick

  • pick(obj: any, keys: string | Array<string>): Object
  • Returns a partial object copy containing only specified keys.

    Notes

    • If a key does not exist as an own property in a source object, the key is ignored.

    Parameters

    • obj: any

      source object

    • keys: string | Array<string>

      keys to copy

    Returns Object

    new object

    Example

    var obj1 = {
        'a': 1,
        'b': 2
    };
    
    var obj2 = pick( obj1, 'b' );
    // returns { 'b': 2 }