I have an array of objectobjects as myData which consists of the below JSON structure:
{ "myData": [ { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" }, { "Type": "REAL", "Tenure": "24", "Name": "SERVER" }, { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" } ] }
const data = {
myData: [
{ Type: 'REAL', Tenure: '12', Name: 'WEBPAGE' },
{ Type: 'REAL', Tenure: '24', Name: 'SERVER' },
{ Type: 'REAL', Tenure: '12', Name: 'WEBPAGE' },
],
};
I want to get rid of duplicate entiresentries by keeping performance in mind as this array could be of length 1000+ using Javascript.
The Expected Output that I am looking for is as follow since myData[0] && myData[2] are duplicate here:
{ "myData": [ { "Type": "REAL", "Tenure": "24", "Name": "SERVER" }, { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" } ] }
const result = {
myData: [
{ Type: 'REAL', Tenure: '24', Name: 'SERVER' },
{ Type: 'REAL', Tenure: '12', Name: 'WEBPAGE' },
],
};
I have an array of object as myData which consists of below JSON structure:
{ "myData": [ { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" }, { "Type": "REAL", "Tenure": "24", "Name": "SERVER" }, { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" } ] }
I want to get rid of duplicate entires by keeping performance in mind as this array could be of length 1000+ using Javascript.
The Expected Output that I am looking for is as follow since myData[0] && myData[2] are duplicate here:
{ "myData": [ { "Type": "REAL", "Tenure": "24", "Name": "SERVER" }, { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" } ] }
I have an array of objects as myData which consists of the below JSON structure:
const data = {
myData: [
{ Type: 'REAL', Tenure: '12', Name: 'WEBPAGE' },
{ Type: 'REAL', Tenure: '24', Name: 'SERVER' },
{ Type: 'REAL', Tenure: '12', Name: 'WEBPAGE' },
],
};
I want to get rid of duplicate entries by keeping performance in mind as this array could be of length 1000+ using Javascript.
The Expected Output that I am looking for is as follow since myData[0] && myData[2] are duplicate here:
const result = {
myData: [
{ Type: 'REAL', Tenure: '24', Name: 'SERVER' },
{ Type: 'REAL', Tenure: '12', Name: 'WEBPAGE' },
],
};
Removing duplicates fromarray of objects
I have an array of object as myData which consists of below JSON structure:
{ "myData": [ { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" }, { "Type": "REAL", "Tenure": "24", "Name": "SERVER" }, { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" } ] }
I want to get rid of duplicate entires by keeping performance in mind as this array could be of length 1000+ using Javascript.
The Expected Output that I am looking for is as follow since myData[0] && myData[2] are duplicate here:
{ "myData": [ { "Type": "REAL", "Tenure": "24", "Name": "SERVER" }, { "Type": "REAL", "Tenure": "12", "Name": "WEBPAGE" } ] }