Skip to content

tip worth mentioning getters / setters #6

@robin-raymond

Description

@robin-raymond

https://github.com/jchadwick/EssentialTypeScriptBook/blob/master/manuscript/05.Classes.md

At this point I want to point out that, even though I've been calling them "getter and setter properties" like they have to go together, this code is actually perfectly legitimate -- you don't need to define a getter AND a setter for a property - you can implement either one or both of them, depending on what you're trying to accomplish.

I believe getters and setters in C# do not allow a setter exclusively without first defining a getter. I think that is worth mentioning here as a note that it is allowed in TS (assuming it is...);

Also when I was searching the legality I read some stuff about odd property inheritance not being o

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions