I have the following array.
"APP-A": {
"active": true
},
"APP-B": {
"active": true
},
"APP-C": {
"active": true
},
"BOOL-A": {
"active": true
},
"BOOL-B": {
"active": true
},
"BOOL-C": {
"active": true
},
I need to get the total count of the APP-*'s in the array. Am trying to implement in angular JS. Solutions in plain JS will also be helpful.
TIA
var count = 0; for (var key in obj) count += /^APP-/.test(key)?