you can shorten the code/constructor and use this:
classDog{// depending if those are private or public, here publicconstructor(publicage:number,publicbreed:string){}getRelativeAge():number{returnthis.age*7}}
that way you don't need to code these parts yourself and with that have one / more lines where you can't make potential bugs :) - so win/win 🎉
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.
Nice examples for typescript concepts :), these do help a lot, depending on how your datastructures are!!
I wanted to add an optimized way of adding properties/fields to your classes:
Instead of this:
you can shorten the code/constructor and use this:
that way you don't need to code these parts yourself and with that have one / more lines where you can't make potential bugs :) - so win/win 🎉