ES6: Use class Syntax to Define a Constructor Function

JavaScript
class Vegetable {
  constructor(name) {
    this.name = name;
  }
}
const carrot = new Vegetable('carrot');
Source

Also in JavaScript: