I have a typescript class with several static properties leave uninitialized such as:
class A {
static foo:number
static bar:number
}
for(const key in A) {
console.log(key)
}
If I compile this code in target ESNext everything is fine and all the keys would be logged.
However, if I change the target to any previous, even ES2020, I will get an empty output.
When I dig into the generated javascript code I could see all the properties had been removed:
"use strict";
class A {
}
for (const key in A) {
console.log(key);
}
How can I keep these properties before ESNext?