Global.Array.union ()
retrieve the union set of a bunch of arrays

  • Parameter Array:
    (Array2, ...) the arrays to unify
  • Returns
    Array the union set
Sourcecode in /home/hannes/helma/modules/core/Array.js:
23:   Array.union = function() {
24:      var result = [];
25:      var map = {};
26:      for (var i=0; i<arguments.length; i+=1) {
27:         for (var n in arguments[i]) {
28:            var item = arguments[i][n];
29:            if (!map[item]) {
30:               result.push(item);
31:               map[item] = true;
32:           }
33:        }
34:     }
35:     return result;
36:  }