class Bags { constructor(options) { this.type = options.type; } discount(){ return "No discounts"; } } const bags = new Bags({type: "raffia"}); bags bags.discount();
class Bags { constructor(options) { this.type = options.type; } discount(){ return "No discounts"; } } class Gnome extends Bags { constructor(options) { super(options); this.color = options.color; } country() { return "Singapore"; } } const gnome = new Gnome({color: "red", type: "leather"}); gnome; gnome.country(); gnome.discount();