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
      • events
        • __keys
        • propertyName
      • static
        • extend
        • seal
      • prototype
        • forEach
        • get
        • on
        • serialize
        • set
        • *
    • can-route
    • can-route-pushstate
    • can-set
    • 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-define/map/map
  • /
  • set
  • / On this page
    • set

      function

      Sets multiple properties on a map instance or a property that wasn't predefined.

      • source

      map.set(props [,removeProps])

      Assigns each value in props to a property on this map instance named after the corresponding key in props, effectively merging props into the Map. If removeProps is true, properties not in props will be set to undefined.

      Parameters

      1. props {Object}:

        A collection of key-value pairs to set. If any properties already exist on the map, they will be overwritten.

      2. removeProps {Boolean}:

        Whether to set keys not present in props to undefined.

      Returns

      {can-define/map/map}:

      The map instance for chaining.

      map.set(propName, value)

      Assigns value to a property on this map instance called propName. This will define the property if it hasn't already been predefined.

      Parameters

      1. propName {String}:

        The property to set.

      2. value {*}:

        The value to assign to propName.

      Returns

      {can-define/map/map}:

      This map instance, for chaining.

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