Skip to content

Commit fc2fc72

Browse files
committed
feat: remove mention of IEEE
1 parent 8c5851d commit fc2fc72

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
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
1820
module.exports = contains;

0 commit comments

Comments
 (0)