A small library with a function that compares an object's field with a value and two others that use the previous to filter arrays of objects.
1
stars
0
forks
source link
Check if parameter is undefined in some operations #2
Open
MarkosKon opened 5 years ago
The operations that use match or includes need to check if the first parameter exists.
For example:
The includes operation at the moment is defined as:
In order to avoid runtime errors if a is undefined (usually a is the object property e.g product.name) it should be refactored to: