In python I can do something like the following to have a property in a class: class Client: def __init__(self, dialect=None, init_conn=False): self.dialect = ... @property def type(self): return self.dialect['name'] Is the equivalent in javascript done with the get prefix, such as with the following? class Client { constructor(dialect, init_conn) { this.dialect = ... }; get type() { return this.dialect.name } } Or, what is the equivalent? Via Active questions tagged javascript - Stack Overflow https://ift.tt/H4UG5yx30
A site where you can share knowledge