It's my first question here!) Why this function return 'undefined'? Thanks
const arr = [1, 1, 2, 1, 2, 1]
selector = function (arr) {
let counter = 0;
arr.forEach(element => {
if (element == 2) {
counter += 1;
}
});
}