All I am trying to achieve is better use of built-in ES functions.
var arr = [0, 1, 2, 3, -1, -2, -3];
function countPositiv(p, c, i, a)
{
if(c > 0){
return p+1;
} else {
return p;
}
}
var positiv = arr.reduce(countPositiv, 0);
console.log(positiv);