class in JavaScript is prototypes with better syntax

class introduced no new object model. It is syntax over the prototype chain, which explains most of the behaviour that surprises people coming from other languages.

class Order {
  total() { return 0; }
}

typeof Order;                              // 'function'
Order.prototype.total;                     // the method lives here
Object.getPrototypeOf(new Order()) === Order.prototype;   // true

const { total } = new Order();
total();   // TypeError — `this` is lost

Methods are on the prototype and are not bound, so passing one as a callback loses this — which is why React components ended up full of .bind(this) in constructors. Class bodies are also always strict mode and the declarations are not hoisted, both of which differ from function and both of which are improvements.