testAt()

Tests a given path under the given root object and returns the values at each step of that path.

This function is valid in v2.8.0 to v2.24.3. This function has been downloaded 63 times.

Parameters

{*} root
Object to start at as the root of the proposed path.
{Array} path
An array of strings and/or numbers that represent the path to be tested under root.

Returns

{Array}
An array having a length less than or equal to that of path where each will be the value for the corresponding path value.

Required Function

This function directly requires the following function which is included automatically:

  • has()
    Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check down the object's prototype chain.

Requiring Functions

This function is directly required by the following functions:

  • deleteAt()
    Tries to delete the value at the specified path starting at root.
  • getAt()
    Gets the value under the given root object and path.
  • hasAt()
    Tests to see if the given path exists under a specific root object.
  • setAt()
    Tries to set a value at the given path under the given root object.