All files index.ts

100% Statements 30/30
100% Branches 0/0
100% Functions 1/1
100% Lines 30/30

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 551x 1x 1x 1x 1x 1x 1x 1x 1x       2x     2x     2x 2x 2x   2x 2x     2x 2x 2x 2x   2x 2x 2x     2x 2x     2x     2x     2x       1x     1x  
import Color from './enum';
import {DayOfWeek} from "./enum-typescript";
import {Student, Teacher} from "./class";
import {Dog} from "./class-typescript";
import {generics} from "./generics";
import {functionalProgramming} from "./functional-programming";
import {closures} from "./closures-and-scope";
import {flowStructuresAndManipulation} from "./flow-structures-and-manipulation";
import {traits} from "./traits";
 
function main() {
    // Standard built-in JavaScript features
    flowStructuresAndManipulation()
 
    // traits
    traits()
 
    // Demonstrating the use of TypeScript and JavaScript enums
    console.log(`### Enum ###`)
    const favoriteColor: string = Color.RED;
    const today: string = DayOfWeek.MONDAY;
 
    console.log(`My favorite color is: ${favoriteColor}`);
    console.log(`Today is: ${today}`);
 
    // Classes
    console.log(`\n### Class ###`)
    const student = new Student("Alice", 16, "10th Grade");
    student.greet();
    student.study();
 
    const teacher = new Teacher("Mr. Smith", 40, "Mathematics");
    teacher.greet();
    teacher.teach();
 
    // Classes - Typescript
    const dog = new Dog('Buddy', 'Golden Retriever');
    dog.greet();
 
    // Generics mean parameterized types.
    generics()
 
    // Closure
    closures();
 
    // Functional programming
    functionalProgramming()
}
 
// Export the main method if needed
export {main};
 
// Run the main method
main()