I would like to know if there is a native javascript code that does the same thing as this:
function f(array,value){ var n = 0; for(i = 0; i < arr
const arr = ["a", "a", "a", "b", "b", "b", "b", "c", "c", "c"]; count = 0; function countValues(array, countItem) { array.forEach(itm => { if (itm == countItem) count++; }); console.log(`${countItem} ${count}`); } countValues(arr, "c");