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