TypeScript Exercises

Goal

  1. Implement methods in exercises.ts
  2. Get existing test cases green!

Directly start the exercise using Online IDE

TypeScript Exercises

Alternative local Setup

TypeScript Exercises (1/3)

  1. Open the training folder in VS Code
    (<your-custom-path>/devon4ng-training).
  2. Open a console (ctrl + shift + รถ)
  3. In the terminal window open the dropdown and select your default shell (or default profile) to git bash
  4. Press the plus sign to open a new git bash

TypeScript Exercises (2/3)

  1. In the console start by installing TypeScript
    npm install -g typescript
  2. The following command should return the installed version:
    tsc --version
  3. Run the following 3 commands:
    
    				git checkout gh-pages
    				cd js-to-ts/ts-exercises
    				tsc -w exercises.ts --lib es2015
    			  

TypeScript Exercises (3/3)

  1. open devon4ng-training/js-to-ts/ts-exercises/result.html with your browser
  2. Now you should see failing UnitTests.
  3. Open /ts-exercises/exercises.ts in VS Code and fix them.

With every file change, tsc will recompile and you can refresh your Browser to see the result, e.g. press F5