I don't understand why .include()
doesn't work here when using a brand new JSON object passed as parameter. I expect b.includes({id:2,name:'a'})
returning true
in all cases, here it only returns expected result when I explicitly specify array element :
const b = [{id:2,name:'a'},{id:3,name:'b'}];
b[0]
{id: 2, name: "a"}
b.includes({id:2,name:'a'});
false
b.includes({id:2,name:"a"});
false
b.includes(b[0]);
true