Here is some typescript code that I have in a NexJS app:
const holeSet:any[] = [];
.....
let xx = 1, yy = 2;
holeSet.push({x:xx,y:yy});
xx = 3;
yy = 4;
holeSet.push({x:xx,y:yy});
holeSet.map((e) => {
console.log("element ::"+JSON.stringify(e));
});
const a = 1;
const b = 2;
if (holeSet.includes({x:a.toString(),y:b.toString()}))
console.log("Value {1;2} FOUND !");
Here is the output produced when running the code above:
element ::{“x”:1,”y”:2}
element ::{“x”:3,”y”:4}
My problem is that I do not know what I am doing wrong.
I expect the message: Value {1;2} FOUND !
to show up, but it does not happen. Why is that ?
A bad syntax in the if statement I assume ??