I'm getting an error message in the console that "this.cardPlace" and "this.flipPlace" are both undefined. I ran a console.log before the if/else condition and they were both functioning correctly. There's probably something small that I'm missing. (I'm quite new to coding, so please don't stone me, haha!) Thanks for your help!
class CardSection {
constructor(_cardPlace, _flipPlace, _cat_section, _flipButton, _min, _max) {
this.cardPlace = _cardPlace;
this.flipPlace = _flipPlace;
this.flippy = function() {
if (_flipButton.value == "side-one") {
this.flipPlace++;
_flipButton.value = "side-two";
document.getElementsByClassName("location").innerHTML = "Answer Side";
_cat_section.src = "cards/" + this.cardPlace + "-" + this.flipPlace + ".tiff";
} else if (_flipButton.value == "side-two") {
this.flipPlace--;
_flipButton.value = "side-one";
document.getElementsByClassName("location").innerHTML = "Question Side";
_cat_section.src = "cards/" + this.cardPlace + "-" + this.flipPlace + ".tiff";
}
};
...
var cat_section = document.getElementById("catechism-section-1");
var flipButton = document.getElementById("flip-button1");
var sect1 = new CardSection(1, 1, cat_section, flipButton, 1, 9);