filterPropNames()

Gets the property names of the specified object using Object.getOwnPropertyNames() and filters the property names using a callback function.

This function is valid in v2.23.0. This function has been downloaded 2 times.

Parameters

{*} obj
The object whose property should be examined and whose property names will potentially be returned.
{Function} tester
The callback function which will be called for each property in obj. This function will be passed (1) the property name, (2) the property value and (3) a reference to obj. For each property the return value will be coerced to a boolean and will be used to see if the property name should be returned.
{boolean=} opt_negate Optional, Default:false
Optional value indicating whether or not the negate the results of each call to tester(). If false-ish the tester() callback should return a true-ish value for any properties should be kept. If true-ish the tester() callback should return a false-ish value for any properties that should be kept.

Returns

{Array}
An array of the property names retrieved from obj.

Required Functions

This function directly requires the following functions which are included automatically:

  • filterEntries()
    Gets the key/value pairs for the properties the specified object using Object.keys() and filters them using a callback function.
  • filterKeys()
    Gets the keys of the specified object using Object.keys() and filters the keys using a callback function.
  • filterPropEntries()
    Gets the key/value pairs for the properties the specified object using Object.getOwnPropertyNames() and filters them using a callback function.
  • filterPropValues()
    Gets the property values of the specified object using Object.getPropertyNames() and filters the values using a callback function.
  • filterValues()
    Gets the property values of the specified object using Object.keys() and filters the values using a callback function.

Requiring Functions

This function is directly required by the following functions:

  • filterEntries()
    Gets the key/value pairs for the properties the specified object using Object.keys() and filters them using a callback function.
  • filterKeys()
    Gets the keys of the specified object using Object.keys() and filters the keys using a callback function.
  • filterPropEntries()
    Gets the key/value pairs for the properties the specified object using Object.getOwnPropertyNames() and filters them using a callback function.
  • filterPropValues()
    Gets the property values of the specified object using Object.getPropertyNames() and filters the values using a callback function.
  • filterValues()
    Gets the property values of the specified object using Object.keys() and filters the values using a callback function.