someClassInstance.constructor.name
is exactly the correct way to do this. Transpilers may not support this, but it is the standard way per the specification. (The name
property of functions declared via ClassDeclaration productions is set in 14.5.15, step 6.)
More Related Contents:
- Override a setter, and the getter must also be overridden
- Nested ES6 classes?
- ECMAScript 6: what is WeakSet for?
- How to mock dependencies for unit tests with ES6 Modules
- What’s the meaning of “=>” (an arrow formed from equals & greater than) in JavaScript?
- What is destructuring assignment and its uses?
- Arrow function without curly braces
- ES6 class variable alternatives
- What do square brackets around a property name in an object literal mean?
- What are the differences (if any) between ES6 arrow functions and functions bound with Function.prototype.bind?
- How do I destructure all properties into the current scope/closure in ES2015?
- How can I mock an ES6 module import using Jest?
- React functional stateless component, PureComponent, Component; what are the differences and when should we use what?
- ES6 exporting/importing in index file
- Unexpected behavior using Array Map on an Array Initialized with Array Fill
- Arrow functions and the use of parentheses () or {} or ({})
- ES6 tagged templates practical usability
- Destructuring Nested objects in javascript | Destructure second level parent and child Objects
- What does calling super() in a React constructor do?
- How to use javascript proxy for nested objects
- ES6 functions, arrow functions and ‘this’ in an ES6 class [duplicate]
- How to call another function within the same object?
- What is the best general practice to timeout a function in promise [closed]
- Wrap long template literal line to multiline without creating a new line in the string
- Declare a class property outside of a class method
- Importing javascript file for use within vue component
- React cannot read property map of undefined
- What is the technical definition of a Javascript iterable and how do you test for it?
- ECMA6 generators: yield promise
- ES6 – declare a prototype method on a class with an import statement