Here is my first JSON array format:
this.columnNames = [
{field : "Name"},
{field : "Address"},
{field : "Age"}
];
Here is my first JSON array format:
this.rowData = [
{Name : "Praveen",Address : "aiff",Age : "12",w : "1",e : "8"},
{Name : "Akashay",Address : "xvn",Age : "15",w : "2",e : "7"},
{Name : "Bala",Address : "hjk",Age : "16",w : "3",e : "6"},
{Name : "Charu",Address : "sss",Age : "17",w : "4",e : "5"},
];
Here I want to to compare the VALUE which is present in the first array(columnNames) and KEYS which is present in the second array. If it's equal, then I want to push those matching data from the second array(rowData) into the new array.
And I want my final result like this:
public rowData: any =[
{Name : "Praveen",Address : "aiff",Age : "12"},
{Name : "Akashay",Address : "xvn",Age : "15"},
{Name : "Bala",Address : "hjk",Age : "16"},
{Name : "Charu",Address : "sss",Age : "17"},
];