File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1- const contains = function ( obj , searchValue ) {
1+ const contains = function ( obj , searchValue ) {
22 const values = Object . values ( obj ) ;
33
4- // NaN === NaN evaluates to false (as per the IEEE 754 standard)
4+ // NaN === NaN evaluates to false
55 // Normally, we would have to do an explicit Number.isNaN() check to compare NaN equality
66 // However, Array.prototype.includes automatically handles this for us
77 if ( values . includes ( searchValue ) ) return true ;
88
9- const nestedObjects = values . filter ( ( value ) => typeof value === 'object' && value !== null ) ;
9+ const nestedObjects = values . filter (
10+ ( value ) => typeof value === "object" && value !== null ,
11+ ) ;
1012 for ( const nestedObject of nestedObjects ) {
1113 return contains ( nestedObject , searchValue ) ;
1214 }
1315
1416 return false ;
1517} ;
16-
18+
1719// Do not edit below this line
1820module . exports = contains ;
You can’t perform that action at this time.
0 commit comments