let C = class
{ // ...
}
Object.defineProperty (C, 'name', {value: 'TheName'});
// test:
let itsName = (new C()).constructor.name;
// itsName === 'TheName' -> true
More Related Contents:
- Private properties in JavaScript ES6 classes
- ES6 class variable alternatives
- ES6 modules: Export single class of static methods OR multiple individual methods
- Call static methods from regular ES6 class methods
- How to extend a class without having to use super in ES6?
- Declaring static constants in ES6 classes?
- Create an instance of a class in ES6 with a dynamic name? [duplicate]
- ES6 classes : what about instrospection?
- Javascript ES6 class definition not accessible in window global
- “This” within es6 class method [duplicate]
- Override a setter, and the getter must also be overridden
- Getting a list of statics on an ES6 class
- What are getters and setters for in ECMAScript 6 classes?
- Why aren’t methods of an object created with class bound to it in ES6?
- How to add mixins to ES6 javascript classes?
- ES6 – declare a prototype method on a class with an import statement
- `export const` vs. `export default` in ES6
- Javascript – arrow functions this in event handler?
- ES6 Iterate over class methods
- Can’t require() default export value in Babel 6.x
- ES6 Destructuring and Module imports
- How can I construct a Template String from a regular string? [duplicate]
- Why es6 react component works only with “export default”?
- What is the defined execution order of ES6 imports?
- Get all instances of class in Javascript
- JSON stringify ES6 class property with getter/setter
- How to create new instance of an extended class of custom elements
- Get the description of a ES6 Symbol
- How to create an array of objects from multiple arrays
- using await on global scope without async keyword