-
Notifications
You must be signed in to change notification settings - Fork 59
Lesson 17 (TypeScript)
Courtney Frey edited this page Apr 14, 2022
·
2 revisions
- What TypeScript is and how it is different from JavaScript.
- The differences between static and dynamic typing.
- How to declare and use:
- Variables of number, string, and boolean types.
- Arrays and tuples.
- Classes and interfaces.
- How to use export and import.
- How to use the
implements
keyword to make classes implement interfaces.
- Check with your class Candidate Engagement Manager for any other announcements.
- Remind the students about the requirements for remaining in the course after Unit 1.
- Graded assignment #6 opens soon. This is the last graded assignment for unit 1.
- Welcome do Days 25 and 26!
- Graded Assignment 5 due end of Day 29
-
Day 25:
- Lesson 17
-
Day 26:
- Self-Assessment 3 in the morning (last one for Unit 1)
- Work day for Assignment 5 rest of day
- Be ready to answer the question, "Why do we need to learn TypeScript?"
- Q & A as needed for the prep-work exercises.
- Review the distinction between classes and interfaces in TypeScript. This comes directly from the last concept check in the reading.
- Review the syntax for function declarations in TypeScript:
- The type must be identified for each parameter.
- If a value is returned, the type for that value must also be identified.
- Note that when a TypeScript file is compiled, the process generates a JavaScript file that can be run.
- Studio intro.
- The GitHub repository for the TypeScript chapter contains starter code and solutions for both the exercises and the studio.
- Remind the students that they need to be in the master branch of the repository. Also remind them to switch to the "studio" folder to find the starter code.
- One common mistake is to declare the
Astronaut
,Cargo
, andRocket
classes in the same file instead of in three separate TypeScript files. - Be ready to answer questions about when and where each class needs to be imported. Encourage your students to read through the entire studio description and sketch the relationships between each class.
- The code the students paste into
index.ts
should be good as-is. Despite the temptation to do so, the students should avoid modifying the code until after they have the studio working as described in the instructions.