We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15e4bec commit c19c1bcCopy full SHA for c19c1bc
14_contains/solution/contains-solution.js
@@ -1,7 +1,7 @@
1
const contains = function(obj, searchValue) {
2
const values = Object.values(obj);
3
4
- // NaN !== NaN, so we would usually have to do an explicit check to test for it. However, Array.prototype.includes handles that for us
+ // NaN !== NaN, so we would usually have to do an explicit check with Math.isNaN to test for it. However, Array.prototype.includes handles that for us
5
if (values.includes(searchValue)) return true;
6
7
const nestedObjects = values.filter((value) => typeof value === 'object');
0 commit comments