I am working on a Vue application that receives a JSON object as shown below. My task is to calculate the count of items where _Valid is set to true. I am not very familiar with the Reduce method in JavaScript and I'm unsure how to filter based on a specific part of a key name. Can someone guide me on where to start? Is this even achievable?
{
"F_Mountain1_Week": "1",
"F_Mountain1_Date": "2021-11-12",
"F_Mountain1_Valid": true,
"F_Mountain2_Week": "1",
"F_Mountain2_Date": "2021-11-12",
"F_Mountain2_Valid": true,
"F_Mountain3_Week": "1",
"F_Mountain3_Date": "2021-11-12",
"F_Mountain3_Valid": true,
"F_Mountain4_Week": "",
"F_Mountain4_Date": "2021-11-12",
"F_Mountain4_Valid": false,
"F_Mountain5_Week": "",
"F_Mountain5_Date": "2021-11-12",
"F_Mountain5_Valid": false,
"F_Mountain6_Week": "",
"F_Mountain6_Date": "2021-11-12",
"F_Mountain6_Valid": false,
"F_Mountain7_Week": "",
"F_Mountain7_Date": "2021-11-12",
"F_Mountain7_Valid": false,
"F_Mountain8_Week": "",
"F_Mountain8_Date": "2021-11-12",
"F_Mountain8_Valid": false,
}