Filtration of multilevel json array in javascript : i am trying to duplicate value only one time as well as unique from my json array.

i have tried the following code.


return_data = {};
return_data.planner = [{
        "date": "2019-08-30T12:10:08.000Z",
        "event": [{
            "name": "Event 1",
            "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
            "color": "#ccccc"
        }]
    },
    {
        "date": "2019-09-30T10:10:08.000Z",
        "event": [{
                "name": "Event 5",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            },
            {
                "name": "Event 4",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            },
            {
                "name": "Event 3",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            }
        ]
    },
    {
        "date": "2019-09-30T10:10:08.000Z",
        "event": [{
                "name": "Event 5",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            },
            {
                "name": "Event 4",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            },
            {
                "name": "Event 3",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            }
        ]
    },
    {
        "date": "2019-09-30T10:10:08.000Z",
        "event": [{
                "name": "Event 5",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            },
            {
                "name": "Event 4",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            },
            {
                "name": "Event 3",
                "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting standard dummy text ever since the 1500s",
                "color": "#ccccc"
            }
        ]
    }
]
res.header('Content-Type', 'application/json');

res.send(JSON.stringify(return_data));

// using above json array.

var u_array = [];

var tem = JSON.parse(JSON.stringify(return_data.response.planner));


for (var i = 0; i < tem.length; i++) {

    console.log(tem[i].date);
    var status = true;
    for (var j = 0; j < u_array.length; j++) {

        if (u_array[j].date == tem[i].date) {
            status = false;
            break;
        }

    }

    if (status) {
        u_array.push(tem[i]);
    }


};


return_data.response.planner = u_array;

i expect the duplicate value only one time with unique values.