JSFiddle - React, Tailwind, and code Playground
JavaScript
var object = new Object();
object.one = new Object();
object.one.x = 0;
object.one.y = 0;
object.two = new Object();
object.two.x = 1;
object.two.y = 1;
var findObject = function(object, x, y) {
for(var subObject in object) {
if(object[subObject].x === x && object[subObject].y === y)
return object[subObject];
}
};
console.log(findObject(object, 1, 1));