Let's say I have a class in ES6 like this:
export default class myClass{
constructor () {
this.logCount = 0
}
log (msg) {
this.logCount++
console.log(this.logCount + " - " + msg)
}
}
Why is this.logCount
in log()
undefined if I access it? What am I missing here?