I am working with a form.value object that looks like this:
form.value = {
"to_date": "2019-03-21T05:00:00.000Z",
"from_date": "2019-03-13T05:00:00.000Z",
"is_form": ""
"errors":""
}
Additionally, I have an array called filterArray:
filterArray = [
"from_date",
"to_date"
]
The goal is to loop through the keys in the form.value object and apply a function (converFormat()) to the values of keys that match the ones in the filterArray:
form.value = {
"to_date": "2019-03-21T05:00:00.000Z", // function() applied since key in filterArray
"from_date": "2019-03-13T05:00:00.000Z", // function() applied since key in filterArray
"is_form": ""
"errors":""
}