Answer the question
In order to leave comments, you need to log in
Is set.has(value) possible under given conditions?
I'm learning JS. Couldn't find an answer:
let xyz = new Set();
xyz.add({ name: "John" });
console.log(xyz.has({ name: "John" })); // false
Question:
Based on the condition above, is there a way to find out xyz.has for { name: "John" } in xyz ?
I'm not interested in any solution to this problem, but in finding out why it is possible / not possible to do xyz.has({ name: "John" }) in the above example.
PS:
I know the solution. Because arrays, like objects, are equal to each other only if they are literally the same piece of computer memory, then:
let xyz = new Set();
let john = { name: "John" };
xyz.add(john);
console.log(xyz.has(john)); // true
But I don't know the answer to the question.
Answer the question
In order to leave comments, you need to log in
Check out this service https://developer.bitaps.com/forwarding , bitcoins are sent immediately after confirmation to the address you specified.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question