4 ms·
If you use classes, the compiler may complain because the class has no declared fields. The compiler will emit JS anyway.
by nikeee 8y ago
If you use classes, the compiler may complain because the class has no declared fields.
The compiler will emit JS anyway.
- vimslayer 8y agoClass field declarations are a stage 3 proposal for EcmaScript, btw, and already supported in Chrome. So class Foo { foo; constructor() { this.foo = 42 } } Will be both valid ES2019 or ES2020 and TypeScript.