Stop being the product.
Become the owner.
or
sign uplog in

trying to finish activity from odin Project, string…

trying to finish activity from odin Project, string implicitly convert to a number?

const contains = function(obj, find) {
  for(let value of Object.values(obj)){
    console.log(typeof(value));
    console.log(value);
    if(value === find) return true;
    if(typeof(value) === 'object'){
      if(contains(value, find)) return true;
    }
  }
  return false;
  }


// Do not edit below this line
module.exports = contains;

const object = {
    data: {
      duplicate: "e",
      stuff: {
        thing: {
          banana: NaN,
          moreStuff: {
            something: "foo",
            answer: meaningOfLifeArray,
          },
        },
      },
      info: {
        duplicate: "e",
        magicNumber: 44,
        empty: null,
      },
    },
  };

I dont know why this returns true when "44" is pass to find

test("does not convert input string into a number when searching for a value within the object", () => {
    expect(contains(object, "44")).toBe(false);
  });

this test fails, because it returns true even tho i have the === operator
#technology #dev #programming
earnings
1,000 mlx total
$0  total
engagement
1 views
0 reactions

0 comments