How to define a class in JavaScript

Syntax
By Jad Joubran · 
Last updated Dec 18, 2017
class Pencil {
  constructor(price) {
    this.price = price;
  }

  isExpensive() {
    return this.price >= 10;
  }
}

//usage
const bic = new Pencil(3);
bic.isExpensive();
false
Classes on MDN