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

      function

      Called when an attribute is removed.

      • source

      remove( currentValue )

      Returns

      {*|false}:

      If false is returned, the value is not removed.

      Use

      The following prevents removing the prop attribute if someone tries to remove the value 0:

      define: {
        prop: {
          remove: function( currentVal ){
            return currentVal !== 0;
          }
        }
      }
      

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