I have a json file which looks like this
[
{
path1:"xyz",
path2: "xyz2",
file1: "filea",
file2: "fileb",
state: "equal"
},
{
path1:"xyz",
path2: "xyz2",
file1: "filec",
file2: "filed",
state: "distinct"
},
{
path1:"xyz",
path2: "xyz2",
file1: "filee",
file2: "filef",
state: "equal"
},
{
path1:"xyz4",
path2: "xyz3",
file1: "fileg",
file2: "fileh",
state: "distinct"
}
]
The problem is I should get the json object data which have the type of state:distinct
which should look like this
[
{
path1:"xyz",
path2: "xyz2",
file1: "filec",
file2: "filed",
state: "distinct"
},
{
path1:"xyz4",
path2: "xyz3",
file1: "fileg",
file2: "fileh",
state: "distinct"
}
]
Is there any solution so that, I can get a json data like above in JavaScript?