Skip to content
ExamplesOpen editor ↗

mofutakwalo

→ class

Declares a class — a blueprint for creating objects.

mofutakwalo Leina { ... }

Classes group data and behaviour together. Define a constructor with motlhophisi to set up new instances, and create instances with dira.

A class with a constructor
mofutakwalo Sediko {
  motlhophisi(r) {
    ye.r = r;
  }
}

motlhophisi, dira, ye