can-symbol
Version:
Well known symbols used to detail how to operate on different objects
22 lines (15 loc) • 710 B
Markdown
String)} can-symbol/symbols/deleteKeyValue can.deleteKeyValue
can-symbol/symbols/get-set
Defines a function that deletes one of an object's named properties.
`@ .deleteKeyValue( key )`
The `can.deleteKeyValue` symbol points to a Map-like object's property removal function, which removes the object's property with the supplied key. This is only applicable to objects where keyed properties are relevant (like maps).
```
var map = {
removeKey: function (key) {
delete this[key];
}
}
map[canSymbol.for('can.deleteKeyValue')] = map.removeKey;
```
{Object} an object with named properties
{String} key the key to remove from the object
{function(