can-symbol
Version:
Well known symbols used to detail how to operate on different objects
22 lines (13 loc) • 626 B
Markdown
Boolean} can-symbol/symbols/getName can.getName
can-symbol/symbols/shape
Returns a human-readable name of an object
`@@can.getName()`
The `@@@@can.getName` symbol points to a function that returns human-readable name of the object. Depending on the context this name could be decorated with extra information, like the `cid` of a given instance.
```js
const foo = function() {};
foo[ canSymbol.for( "can.getName" ) ] = function() {
return "MyFooFunction";
};
obj[ canSymbol.for( "can.getName" ) ](); //-> "MyFooFunction"
```
{String} The name of the object/function
{