How can i filter the Event_Type ? what I want is to get the value of Event_Type which is the MT
this is my current code
if (cachedData) {
let cachedDatas = JSON.parse(cachedData);
for (var data in cachedDatas) {
var keys = data == 'Event_Type' ? 'R150274705' : data;
console.log("keys", keys)
let code = data.filter((val) => {
return cachedDatas['Event_Type'] == val.code;
})
}
}
this is the data
{"Event_Type":"MT","Subject":"","startDate":"07/05/2022 11:43 AM","startDateRaw":"2022-05-07T03","description":""}
What about a very simple solution like this?
const jsonStr='{"Event_Type":"MT","Subject":"","startDate":"07/05/2022 11:43 AM","startDateRaw":"2022-05-07T03","description":""}';
console.log(JSON.parse(jsonStr).Event_Type);