matchesProperty
Modified on Thu, 24 Aug 2023
Description
Use this function to create a function that performs a partial deep comparison between the value at a specified path of a given object and a source value. It returns 'true' if the object value is equivalent to the source value; otherwise, it returns 'false'.
Syntax
matchesProperty(path: PropertyPath, srcValue: T)
Returns
Return Value | Description |
---|---|
Boolean | Returns 'true' if the value at the specified path of the object is equivalent to the source value; otherwise, 'false'. |
Sample
Example | Result | Description |
---|---|---|
matchesProperty('city', 'New York') | true | Returns 'true' because the value at the 'city' path of the object is 'New York', which matches the source value. |
matchesProperty('state', 'NY') | true | Returns 'true' because the value at the 'state' path of the object is 'NY', which matches the source value. |
To view all Object functions, click here.
See Also
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article