Objects and Data Structures
Make objects have private/protected members
class Circle {
public radius: number
public constructor(radius: number) {
this.radius = radius
}
}
class Circle {
public constructor(private readonly _radius: number) {}
}
Prefix private members with an underscore
class Foo {
private readonly bar: number
private baz(): number {
...
}
}
class Foo {
private readonly _bar: number
private _baz(): number {
...
}
}