bobbyache icon

TypeScript - Getter and Setter Properties

bobbyache | PRO | 09/27/19 07:32:07 AM UTC | 0 ⭐ | 277 👁️ | Never ⏰ | []
text |

270 B

|

None

|

0 👍

/

0 👎

get fileNameWithoutExt(): string {
    return this.fileName.substring(0, this.fileName.lastIndexOf('.'));
}
 class foo {
  private _bar:boolean = false;
   get bar():boolean {
    return this._bar;
  }
  set bar(theBar:boolean) {
    this._bar = theBar;
  }
}

Comments