I'm relatively new to JavaScript and have a question that may seem basic. I've been struggling to find the answer, possibly because I'm not using the correct terminology.
My goal is to count the number of "active" fields in a JSON file that are set to true versus false, and then store those values in a variable. I'm finding it challenging to figure out how to approach this task.
Here's an example of my JSON data, which I've named data:
{
"systems": [
{
"name": "SV001",
"IP": "10.1.1.101",
"active": "true"
},
{
"name": "SV002",
"IP": "10.1.1.102",
"active": "true"
},
{
"name": "SV003",
"IP": "10.1.1.103",
"active": "false"
}
]}
I would greatly appreciate any assistance with this issue. Thank you!