// Base Class
class Product {
constructor(quantity, color){
this.quantity = quantity;
this.color = color;
this.createCheckout()
}
createCheckout(){
let order = {
amount: this.quantity,
color: this.color
}
}
}
class MyProduct extends Product {
constructor(quantity, color, newProp) {
super(quantity, color)
this.newProp = newProp;
}
createCheckout() {
let order = {
amount: this.quantity,
color: this.color,
newProp: this.newProp
console.log(order) // outputs everything correct, but "newProp" is undefined