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
      • prototype
        • DEFAULT-ATTR
        • attr
        • bind
        • compute
        • each
        • removeAttr
        • serialize
        • unbind
      • static
        • keys
    • can-map-backup
    • can-map-define
    • can-view-href
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Legacy
  • /
  • can-map
  • /
  • removeAttr
  • / On this page
    • removeAttr

      function

      Remove a property from a Map.

      • source

      map.removeAttr(attrName)

      Parameters

      1. attrName {String}:

        the name of the property to remove

      Returns

      {*}:

      the value of the property that was removed

      removeAttr removes a property by name from a Map.

      var people = new Map({a: 'Alice', b: 'Bob', e: 'Eve'});
      
      people.removeAttr('b'); // 'Bob'
      people.attr();          // {a: 'Alice', e: 'Eve'}
      

      Removing an attribute will cause a change event to fire with 'remove' passed as the how parameter and undefined passed as the newVal to handlers. It will also cause a property name event to fire with undefined passed as newVal. An in-depth description at these events can be found under attr.

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