var arr = ['string', 67, {}, null, 2, "54"]; var result = arr.reduce(function(previousValue, currentValue){ if(typeof(currentValue)==='number'){ previousValue*=currentValue; }; return previousValue }, 1) alert(result);