✅✅✅Javascript || Short & Simple || Faster than 90.03%
iterate over items and check rule\n\nvar countMatches = function(items, ruleKey, ruleValue) {\n    let count = 0;\n    let indexes = {\n        "type": 0,\n    
**iterate over items and check rule**\n```\nvar countMatches = function(items, ruleKey, ruleValue) {\n    let count = 0;\n    let indexes = {\n        "type": 0,\n        "color": 1, \n        "name": 2\n    }\n    for (let item of items) {\n        if (item[indexes[ruleKey]] === ruleValue) count++;\n    }\n    return count\n};\n```
['JavaScript']