re: A Complete Introduction Guide To TypeScript VIEW POST

FULL DISCUSSION
 

By adding three backticks followed by ts you can colourize your code in this article which will improve readability.

class Animal {
    move(steps: number = 0) {
        console.log(`Animal moved ${steps}m.`);
    }
}

class cat extends Animal {
    meow() {
        console.log('Meow');
    }
}

const cat= new Cat();
cat.meow();
cat.move(1000);
code of conduct - report abuse