Gets the name of a value.
If the value is a function, its name is returned. If the value is a symbol, its key is returned. If the value is a string, it is returned as is. Otherwise, null is returned.
10.2.0
The name of the value.
name(class Foo{})// => "Foo"name(function bar(){})// => "bar"name(Symbol.for("abc"))// => "abc"name("foo")// => "foo"name(1)// => null
Value to check.
Generated using TypeDoc
Gets the name of a value.
If the value is a function, its name is returned. If the value is a symbol, its key is returned. If the value is a string, it is returned as is. Otherwise, null is returned.
Since
10.2.0
Returns
The name of the value.
Example