Concise declarations
Use fun or function, val for read-only values, and primary-constructor class members. Operator overloading and shorthand functions and properties.
class Point(val x: number, val y: number) {
operator+() { return this }
operator-() => Point(-x, -y)
operator+(other: Point) => Point(x + other.x, y + other.y)
operator-(other: Point) => Point(x - other.x, y - other.y)
operator*(scale: number) => Point(x * scale, y * scale)
length => Math.hypot(x, y)
}
val point = -Point(1, 2) + Point(3, 4) * 2