DEV Community

Discussion on: A Complete Introduction Guide To TypeScript

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦

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);