can-map
Version:
Observable Objects
25 lines (16 loc) • 827 B
Markdown
prototype.removeAttr removeAttr
can-map.prototype 6
Remove a property from a Map.
`map.removeAttr(attrName)`
{String} attrName the name of the property to remove
{*} 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 `[can-map.prototype.attr attr]`.
can-map.