DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
    • can-component
    • can-compute
    • can-connect
    • can-define
    • can-define/list/list
    • can-define/map/map
    • can-route
    • can-route-pushstate
    • can-set
      • types
        • Set
        • Compares
        • Prop
      • properties
        • Algebra
          • prototype
            • difference
            • equal
            • getSubset
            • getUnion
            • has
            • index
            • intersection
            • properSubset
            • subset
            • union
        • Translate
        • props
    • can-stache
    • can-stache/helpers/route
    • can-stache-bindings
  • Ecosystem
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Core
  • /
  • can-set
  • /
  • Algebra
  • /
  • getUnion
  • / On this page
    • getUnion

      function
      • source

      algebra.getUnion(a, b, aItems, bItems)

      Unifies items from set A and setB into a single array of items.

      algebra = new set.Algebra(
        set.props.rangeInclusive("start","end")
      );
      algebra.getUnion(
        {start: 1,end: 2},
        {start: 2,end: 4},
        [{id: 1},{id: 2}],
        [{id: 2},{id: 3},{id: 4}]);
        //-> [{id: 1},{id: 2},{id: 3},{id: 4}]
      

      Parameters

      1. a {Set}:

        A set.

      2. b {Set}:

        A set.

      3. aItems {Array<Object>}:

        Set a's items.

      4. bItems {Array<Object>}:

        Set b's items.

      Returns

      {Array<Object>}:

      Returns items in both set a and set b.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.