TypeScript Syntax for Custom Getters and Setters

Here is the TypeScript syntax to define custom getters and setters for variables:

    private _myVar: number    get myVar(): number {        return this._myVar;    }    set myVar(myVar) {        this._myVar = myVar;        callSomeOtherFunction();    }    retrieveCurrentMyVar(): number {        return this.myVar; // calls the getter myVar() above    }