38. Map reduce map = function () { for (var i = 0; i < this.tags.length; i++) { emit(this.tags[i], this.state == "published" ? 1 : 0); } } reduce = function (key, values) { var total = 0; for (var i = 0; i < values.length; i++) { total += values[i]; } return total; }