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
  • /
  • getSubset
  • / On this page
    • getSubset

      function
      • source

      algebra.getSubset(a, b, bData)

      Gets a set's items given a super set b and its items.

      algebra.getSubset(
        {type: "dog"},
        {},
        [{id: 1, type:"cat"},
         {id: 2, type: "dog"},
         {id: 3, type: "dog"},
         {id: 4, type: "zebra"}]
      ) //-> [{id: 2, type: "dog"},{id: 3, type: "dog"}]
      

      Parameters

      1. a {Set}:

        The set whose data will be returned.

      2. b {Set}:

        A superset of set a.

      3. bData {Array<Object>}:

        The data in set b.

      Returns

      {Array<Object>}:

      The data in set a.

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