Let's say I have an array containing multiple dictionaries like so :
var coords = [{'x': 0, 'y': 0}, {'x': 2, 'y': 5}, {'x': 1, 'y': 6}]
And I try to run a array.includes
on it, it simply doesn't work :
console.log( coords.includes({'x': 0, 'y': 0}) )
// Output : false
It only does this when I work with an array containing dictionaries. For example this works just fine :
var coords = ['0-0', '2-5', '1-6']
console.log( coords.includes('0-0') )
// Output : true
Is there a reason for this? And would there be a way to make it work with dictionaries?