Top "Es6-class" questions

This tag is for questions regarding Classes in Ecmascript 6. The tag is only for classes provided in the Ecmascript version.

Call static methods from regular ES6 class methods

What's the standard way to call static methods? I can think of using constructor or using the name of the …

javascript class static ecmascript-6 es6-class
Are JavaScript ES6 Classes of any use with asynchronous code bases?

What can ES6 Classes provide, as a pattern of organization, to asynchronous code. Below is an example with ES7 async/…

asynchronous ecmascript-6 es6-promise es6-class
TypeScript Unexpected token, A constructor, method, accessor or property was expected

Just trying to write a function within a class using typescript. class Test { function add(x: number, y: number): number { …

javascript typescript ecmascript-6 es6-class
How do I use a static variable in ES6 class?

I'm trying to use a static variable in es6. I'd like to declare a static variable count in Animal class …

javascript ecmascript-6 es6-class
Error: Minified React error #130

I have the following ReactJs component in file ./MyInput.react.js import React from 'react'; export default class MyInput extends …

reactjs ecmascript-6 es6-class
Angular: 7.2.1 ES6 class ReferenceError : Cannot access 'X' before initialization

I'm having the following TypeScript class export class Vehicule extends TrackableEntity { vehiculeId: number; constructor() { super(); return super.proxify(this); } } my …

javascript angular typescript webpack es6-class
How to clone a javascript ES6 class instance

How do I clone a Javascript class instance using ES6. I'm not interested in solutions based on jquery or $extend. …

javascript node.js ecmascript-6 es6-class
ES6 Singleton vs Instantiating a Class once

I see patterns which make use of a singleton pattern using ES6 classes and I am wondering why I would …

javascript es6-class
how to define a static property in the ES6 classes

I want to have a static property in an ES6 class. This property value is initially an empty array. class …

javascript ecmascript-6 static es6-class
How do I export more than one class component with React JS?

I'm new to React and would like to keep all my components in one file. How do I export more …

javascript reactjs function components es6-class