How to use the union function from underscore

Find comprehensive JavaScript underscore.union code examples handpicked from public code repositorys.

876
877
878
879
880
881
882
883
884
885
886
887
888






app.post('/render-draft', [requireAuth, bodyParser.urlencoded({extended: true})], function (request, response) {
	var pieces = getLinesFromData(request.body.markdown);
	pieces.metadata = _.union(pieces.metadata, ["@@ BodyClass=post"]);
	//var titleIndex = pieces.metadata.findIndex(/^@@ Title=/);
	//pieces.metadata[titleIndex] = "@@ Title=DRAFT – " + pieces.metadata[titleIndex].substr(9) + " – DRAFT";
	var result = generateHtmlAndMetadataForLines(pieces);
	response.send(result.html());
fork icon55
star icon265
watch icon27

+ 38 other calls in file

317
318
319
320
321
322
323
324
325
326
    reportOn(0, entry);
  });
};

var allLeafs = function () {
  return _.union(_.map(_.filter(entries, isLeaf), entryName));
};

var leafTotal = function (leafName) {
  var total = 0;
fork icon0
star icon7
watch icon4

+ 5 other calls in file

3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
.then(function(data){
    //let actionplanQuestionIds = _.uniq(_.pluck(actionPlans,'questionId'))
    let customerActionQuestionIds = _.uniq(_.pluck(actionPlans,'questionId'));
    let customerQuestionIds = _.uniq(_.pluck(questionList,'questionId'));

    let questionIds = _.union(customerActionQuestionIds,customerQuestionIds);
    let customerPositiveActionPlan = _.reject(actionPlans,(planData)=>{
        return !planData.isPositive
    })
    let categoryPositiveActionPlan = _.reject(data,(planData)=>{
fork icon0
star icon0
watch icon1

820
821
822
823
824
825
826
827
828
829
previousUpdateWasBigDelete = isBigDelete

if (shouldConcat) {
  // check if the user in this update is already present in the earliest update,
  // if not, add them to the users list of the earliest update
  earliestUpdate.meta.user_ids = _.union(earliestUpdate.meta.user_ids, [
    update.meta.user_id,
  ])

  docId = update.doc_id.toString()
fork icon0
star icon0
watch icon202

+ 5 other calls in file