Skip to content

Lesson 17 (TypeScript)

Sally Steuterman edited this page Jul 27, 2020 · 2 revisions

Lesson 17: TypeScript

In the prep work this week (TypeScript), the students learned:

  1. What TypeScript is and how it is different from JavaScript.
  2. The differences between static and dynamic typing.
  3. How to declare and use:
    1. Variables of number, string, and boolean types.
    2. Arrays and tuples.
    3. Classes and interfaces.
  4. How to use export and import.
  5. How to use the implements keyword to make classes implement interfaces.

Large Group Time (Instructor Notes)

Announcements

  1. Graded assignment #6 opens soon. This is the last graded assignment for unit 1.
  2. Remind the students about the requirements for remaining in the course after unit 1.
  3. Check with your class Candidate Engagement Manager for any other announcements.

Topics That Require More Attention

  1. Be ready to answer the question, "Why do we need to learn TypeScript?"
  2. Q & A as needed for the prep-work exercises.
  3. Review the distinction between classes and interfaces in TypeScript. This comes directly from the last concept check in the reading.
  4. Review the syntax for function declarations in TypeScript:
    1. The type must be identified for each parameter.
    2. If a value is returned, the type for that value must also be identified.
  5. Note that when a TypeScript file is compiled, the process generates a JavaScript file that can be run.
  6. Studio intro.

Studio (TF Notes)

  1. The GitHub repository for the TypeScript chapter contains starter code and solutions for both the exercises and the studio.
  2. 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.
  3. One common mistake is to declare the Astronaut, Cargo, and Rocket classes in the same file instead of in three separate TypeScript files.
  4. 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.
  5. 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.