Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/propEq

Index

References

Functions

References

Renames and re-exports propEq

Functions

  • propEq(prop: string | number | symbol, value: any, obj: any): boolean
  • propEq(prop: string | number | symbol, value: any): (obj: any) => boolean
  • propEq(prop: string | number | symbol): CurriedFunction2<any, any, boolean>
  • Returns true if the specified object property is equal to the given value; false otherwise.

    example
     var abby = {name: 'Abby', age: 7, hair: 'blond'};
    var fred = {name: 'Fred', age: 12, hair: 'brown'};
    var rusty = {name: 'Rusty', age: 10, hair: 'brown'};
    var alois = {name: 'Alois', age: 15, disposition: 'surly'};
    var kids = [abby, fred, rusty, alois];
    var hasBrownHair = propEq('hair', 'brown');
    filter(hasBrownHair, kids); //=> [fred, rusty]

    Parameters

    • prop: string | number | symbol
    • value: any
    • obj: any

    Returns boolean

  • Returns true if the specified object property is equal to the given value; false otherwise.

    example
     var abby = {name: 'Abby', age: 7, hair: 'blond'};
    var fred = {name: 'Fred', age: 12, hair: 'brown'};
    var rusty = {name: 'Rusty', age: 10, hair: 'brown'};
    var alois = {name: 'Alois', age: 15, disposition: 'surly'};
    var kids = [abby, fred, rusty, alois];
    var hasBrownHair = propEq('hair', 'brown');
    filter(hasBrownHair, kids); //=> [fred, rusty]

    Parameters

    • prop: string | number | symbol
    • value: any

    Returns (obj: any) => boolean

      • (obj: any): boolean
      • Parameters

        • obj: any

        Returns boolean

  • Returns true if the specified object property is equal to the given value; false otherwise.

    example
     var abby = {name: 'Abby', age: 7, hair: 'blond'};
    var fred = {name: 'Fred', age: 12, hair: 'brown'};
    var rusty = {name: 'Rusty', age: 10, hair: 'brown'};
    var alois = {name: 'Alois', age: 15, disposition: 'surly'};
    var kids = [abby, fred, rusty, alois];
    var hasBrownHair = propEq('hair', 'brown');
    filter(hasBrownHair, kids); //=> [fred, rusty]

    Parameters

    • prop: string | number | symbol

    Returns CurriedFunction2<any, any, boolean>

Generated using TypeDoc