Skip to content

Commit cc0d9d0

Browse files
committed
Added first 7 exercises
0 parents  commit cc0d9d0

34 files changed

+2763
-0
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.vscode

Diff for: README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<a href="https://totaltypescript.com"><img src="https://res.cloudinary.com/total-typescript/image/upload/v1662641493/beginners-typescript-tutorial/github_2x_vxqai9.png" alt="beginner typescript tutorial" /></a>
2+
3+
## Quickstart
4+
5+
Clone this repo or [open in Gitpod](https://gitpod.io/#https://github.com/total-typescript/beginners-typescript).
6+
7+
```sh
8+
# Installs all dependencies
9+
npm install
10+
11+
# Starts the first exercise
12+
npm run exercise 01
13+
14+
# Runs linting and tests on the solution
15+
npm run solution 01
16+
```
17+
18+
## Video Walkthrough
19+
20+
I walked through the first few exercises on [VSCode's live stream](https://www.youtube.com/watch?v=p6dO9u0M7MQ)! The plan for these exercises is to develop them into a full workshop, and then bundle them into the full video course - [Total TypeScript](https://totaltypescript.com).
21+
22+
## How to take the course
23+
24+
You'll notice that the course is split into exercises. Each exercise is split into a `*.problem.ts` and a `*.solution.ts`.
25+
26+
To take an exercise:
27+
28+
1. Go into `*.problem.ts`
29+
2. Run `npm run exercise 01`, where `01` is the number of the exercise you're on.
30+
31+
The `exercise` script will run TypeScript typechecks and a test suite on the exercise.
32+
33+
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:
34+
35+
1. Check out [TypeScript's docs](https://www.typescriptlang.org/docs/handbook/intro.html)
36+
2. Try to find something that looks relevant.
37+
3. Give it a go to see if it solves the problem.
38+
39+
You'll know if you've succeeded because the tests will pass.
40+
41+
**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!
42+
43+
You can run `npm run solution 01` to run the tests and typechecking on the solution.
44+
45+
## Acknowledgements
46+
47+
Say thanks to Matt on [Twitter](https://twitter.com/mattpocockuk) or by joining his [Discord](https://discord.gg/8S5ujhfTB3). Consider signing up to his [Total TypeScript course](https://totaltypescript.com).
48+
49+
## Reference
50+
51+
### `npm run exercise 01`
52+
53+
Alias: `npm run e 01`
54+
55+
Run the corresponding `*.problem.ts` file.
56+
57+
### `npm run solution 01`
58+
59+
Alias: `npm run s 01`
60+
61+
Run the corresponding `*.solution.ts` file. If there are multiple, it runs only the first one.

Diff for: notes/FUTURE.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Things to add
2+
3+
- classes
4+
- Omit, Partial, Pick, Required, Record (object-based utility types)
5+
- ReadonlyArray
6+
7+
## Things NOT to add
8+
9+
These things are out-of-scope, or will be included in other modules
10+
11+
- limits of typeof narrowing (unknown and object)
12+
- Type predicates
13+
- Using external libraries and @types
14+
- discriminated unions
15+
- narrowing on discriminated unions
16+
- Template literals
17+
- Branded types
18+
- Readonly properties on objects
19+
- Index signatures
20+
- `keyof`
21+
- Readonly, Exclude, Extract (union-based or readonly-based utility types)
22+
- let vs const vs as const
23+
- Function overloads
24+
- typeof
25+
- Generics in functions

Diff for: og-image.png

163 KB
Loading

0 commit comments

Comments
 (0)