JavaScript typeof undefined in class

When I make a class: class DialogueChoice { constructor(text, resultFunc) //dialogue line text, function to call when selected { this.integer = 25; … } test() { console.log(typeof(this.integer)) } } I get undefined as the type instead of a number when calling test(). Why is this? what am I missing? It happens for the other members… Read More JavaScript typeof undefined in class