I have two arrays and want to filter the array from another using reactjs.
I want to display only checked=true and the value property in first array is equal to the listname in second array.
can anyone help to provide the sample code to do that?
Firstarray:
[
{
"listname": "Cash Deposit",
"totalsuccess": "45"
},
{
"listname": "Cash Withdrawl",
"totalsuccess": "25"
},
{
"listname": "Fund Transfer",
"totalsuccess": "9"
}
]
Second array:
[
{
"name": "txn",
"value": "Cash Deposit",
"checked": true
},
{
"name": "txn",
"value": "Cash Withdrawl",
"checked": false
}
]