Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Laptop {
- isOn = false;
- constructor(info, quality) {
- this.info = info;
- this.quality = quality;
- }
- turnOn() {
- this.isOn = true;
- this.quality--;
- }
- turnOff() {
- this.isOn = false;
- this.quality--;
- }
- showInfo() {
- let output = JSON.stringify(this.info);
- console.log(output);
- }
- get price() {
- let price = (800 - (this.info.age * 2) + (this.quality * 0.5));
- return price;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement