First: It's good to know how it works under the hood but today you can just use es6 classes and with typescript you dont need to check the type yourself. Just define the input a string.
Second: Whenever you need a a combination of values a getter is usefull. For example a component has 2 attributes. One const for MAX_ENTRIES and another one for an array entries. The getter would be smth like entriesLeft and returns MAX_ENTRIES - entries.length.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First: It's good to know how it works under the hood but today you can just use es6 classes and with typescript you dont need to check the type yourself. Just define the input a string.
Second: Whenever you need a a combination of values a getter is usefull. For example a component has 2 attributes. One const for MAX_ENTRIES and another one for an array entries. The getter would be smth like entriesLeft and returns MAX_ENTRIES - entries.length.