I have an array object as follows:
details :
Array[2]
>0: Object
Name:"a"
Desc:"Desc"
>1: Object
Name:"b"
Desc:"Desc2"
>2: Object
Name:"C"
Desc:"Desc"
I want to remove the last object since the "Desc" has the duplicate entry with the first entry.
I tried this approach in javascript,
removedup = details.reduce(function(a,b) { if (a.indexOf(b) < 0) a.push(b); return a },[]);
I want the output, to remove the duplicates and therefore adjust the array size.
details :
Array[1]
>0: Object
Name:"a"
Desc:"Desc"
>1: Object
Name:"b"
Desc:"Desc2"
what can I modify in logic?