I have two variables with the name condition and Data. need to find condition fields key in Data variable. need to reassign the value in different variable.
let condition = {
"velocity_global_sync": true,
"allowSync": false
}
let Data = {
"organization_id": 4002400004,
"organization_name": "Velocity Global Integration Sandbox",
"payload": {
"offer": {
"application_id": 34587141004,
"allowSync": true,
"custom_fields": {
"velocity_global_sync": {
"name": "Velocity Global Sync",
"type": "boolean",
"value": true
},
},
"id": 4555342004
}
}
}
condition will not be static. Need to find the keys (velocity_global_sync, allowSync) from Data variable and return the keys value. response object should be like below
let response = {
"velocity_global_sync": true, // velocity_global_sync value have same value from Data velocity_global_sync value so, its return true
"allowSync": false // allowSync value have different value from Data allowSync value so, its return false.
}