DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
  • Legacy
    • can-ejs
    • can-list
    • can-map
    • can-map-backup
    • can-map-define
      • Type
      • Value
      • type
      • attribute definition
      • get
      • remove
      • serialize
      • set
      • value
    • can-view-href
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Legacy
  • /
  • can-map-define
  • /
  • Value
  • / On this page
    • Value

      function

      Provides a constructor function to be used to provide a default value for a certain property of a Map. This constructor will be invoked with new each time a new instance of the map is created.

      • source

      constructorFunc

      A constructor function can be provided that is called to create a default value used for this property, like:

      define: {
        prop: {
          Value: Array
        },
        person: {
          Value: Person
        }
      }
      

      Similar to value, this uppercase version provides a mechanism for providing a default value. If the default value is an object, providing a constructor is a good way to ensure a copy is made for each instance.

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