// when blog is done https://cookeylangblog.cookeylangteam.repl.co

classes

Classes can be used to define submethods.

Create

class MyClass {
  construct(val) {
    this.val = val;
  }
}

the this keyword returns the class.
the construct method is used to change the behaviour of how a class is initiated.

Initiate

var myInstance = MyClass();

Errors

class MyClass {
  construct(val) {
    this.val = val;
    ret val;
  }
}

Constructors cannot return values. This holds for empty returns (return;) as well.

Inheritance

Classes can inherit from each other.

class SuperClass {}
class MyClass extends SuperClass {}