Reputation: 1419
I have the following array of objects:
[{x: "1", y: "2", test: "9.000", class: "low-latency"},
{x: "2", y: "3", test: "9.000", class: "low-latency"},
{x: "22", y: "22", test: "0.000", class: "low-latency"},
{x: "22", y: "22", test: "127.000", class: "high-latency"},
{x: "5", y: "6", test: "96.000", class: "high-latency"},
{x: "6", y: "7", test: "66.000", class: "low-latency"},
{x: "7", y: "8", test: "71.000", class: "high-latency"}]
This is a part of a react reducer so this gets updated every x number of seconds based on the data being returned from a socket.
What I need to do is make sure that when x and y have the same value - there should be just one of them. What is the best way to achieve this?
Upvotes: 1
Views: 857