class Seller { cars = []; sell() { if (this.cars.length === 0) { throw "No cars for sale"; } //具体实现…… } }let seller = new Seller();seller.sell(); //<- Error: No cars for sale