class MyClass {
a = Symbol()
b = this.a
}
class MyClass2 {
a = Symbol()
constructor() {
this.b = this.a
}
}
Why this
keyword can be used outside of constructor/methods like in MyClass
? Should MyClass2
syntax be used instead?
class MyClass {
a = Symbol()
b = this.a
}
class MyClass2 {
a = Symbol()
constructor() {
this.b = this.a
}
}
Why this
keyword can be used outside of constructor/methods like in MyClass
? Should MyClass2
syntax be used instead?