scrimba
JS Deep Dive
Classes
How To Get, Set and Simplify Classes
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

How To Get, Set and Simplify Classes
AboutCommentsNotes
How To Get, Set and Simplify Classes
Expand for more info
index.js
run
preview
console
class Product {
constructor(name, price, discountable) {
this.name = name;
this.price = price;
this.discountable = discountable;
}

getClearancePrice() {
return this.price * 0.5;
}
}

const product1 = new Product("Coffee Maker", 99.95, false);
Console
index.html
-9:42