GitHub - total-typescript/beginners-typescript-tutorial: An interactive TypeScript tutorial for begi

原文转载自 「Github Trending」 ( https://github.com/total-typescript/beginners-typescript-tutorial ) By github

预计阅读时间 0 分钟(共 0 个字, 0 张图片, 0 个链接)

beginner typescript tutorial

Quickstart

Clone this repo or open in Gitpod.

# Installs all dependencies
npm install

# Starts the first exercise
npm run exercise 01

# Runs linting and tests on the solution
npm run solution 01

Video Walkthrough

I walked through the first few exercises on VSCode's live stream! The plan for these exercises is to develop them into a full workshop, and then bundle them into the full video course - Total TypeScript.

How to take the course

You'll notice that the course is split into exercises. Each exercise is split into a *.problem.ts and a *.solution.ts.

To take an exercise:

  1. Go into *.problem.ts
  2. Run npm run exercise 01, where 01 is the number of the exercise you're on.

The exercise script will run TypeScript typechecks and a test suite on the exercise.

This course encourages active, exploratory learning. In the video, I'll explain a problem, and you'll be asked to try to find a solution. To attempt a solution, you'll need to:

  1. Check out TypeScript's docs
  2. Try to find something that looks relevant.
  3. Give it a go to see if it solves the problem.

You'll know if you've succeeded because the tests will pass.

If you succeed, or if you get stuck, unpause the video and check out the *.solution.ts. You can see if your solution is better or worse than mine!

You can run npm run solution 01 to run the tests and typechecking on the solution.

Acknowledgements

Say thanks to Matt on Twitter or by joining his Discord. Consider signing up to his Total TypeScript course.

Reference

npm run exercise 01

Alias: npm run e 01

Run the corresponding *.problem.ts file.

npm run solution 01

Alias: npm run s 01

Run the corresponding *.solution.ts file. If there are multiple, it runs only the first one.