JSFiddle - React, Tailwind, and code Playground
by stevebeauge
JavaScript
const data = [ {
"X": 10, "Y": 10, "Value":"foo"
},
{
"X": 20, "Y": 5, "Value":"bar"
}, {
"X": 30, "Y": 15, "Value":"kitty"
}
];
const first = (X,Y)=>data.filter((element, index, array)=>{
return X===element.X && Y===element.Y;
});
console.log(first(10,10));