Day 2: title formatting coherence, minor edits

This commit is contained in:
Elizabeth Craig
2019-03-05 02:42:26 -08:00
parent 8c99c83353
commit 46094abe9d
11 changed files with 40 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
# Step 2.1: Introduction to TypeScript (Demo)
# Step 2.1 - Introduction to TypeScript (Demo)
[Lessons](../../) | [Exercise](../exercise/)
@@ -28,11 +28,11 @@ The most important ones to know about are:
> For more information about the _many_ modularity patterns and standards developed over time, see [this article](https://medium.freecodecamp.org/javascript-modules-a-beginner-s-guide-783f7d7a5fcc). You may still encounter some of the older patterns in legacy code.
## TypeScript Types
## TypeScript types
Refer to [`demo/src/types`](./src/types/index.ts) for examples of some of the types available in TS that benefit a React developer.
## Spread Operator
## Spread operator
The spread operator `...` provides a quick way to clone and concatenate objects and arrays. This syntax is seen a lot inside React props and Redux reducers.
@@ -139,7 +139,7 @@ aPromise
> For more information, see [this overview of promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) or [this deep dive](https://developers.google.com/web/fundamentals/primers/promises).
## Async / Await
## Async / await
**Async / Await** is a language-level feature for writing asynchronous functions as if they are ordinary, synchronous code. JS support for this is built on top of `Promise`s and is inspired heavily by [C#'s async / await syntax](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/). An async function is written like this:

View File

@@ -1,4 +1,4 @@
# Step 2.1: Introduction to TypeScript (Exercise)
# Step 2.1 - Introduction to TypeScript (Exercise)
[Lessons](../../) | [Demo](../demo/)
@@ -20,7 +20,7 @@ Exercises will be completed under this step's `exercise/src` folder unless other
5. Inside `index.ts` in the same folder, import both `fib` and `FibConst`, and use the built-in `console.log()` function to log the result of `fib(FibConst)`.
## Types and Interfaces
## Types and interfaces
Inside `exercise/src/index.ts`:
@@ -38,7 +38,7 @@ Inside `exercise/src/stack.ts`, create a generic class for a `Stack<T>` complete
In `exercise/src/index.ts`, create a `Stack<number>` and use `console.log()` to demonstrate its functionality.
## Spread and Destructuring
## Spread and destructuring
1. Note the following code in index.ts:
@@ -61,7 +61,7 @@ const obj2 = {
3. Use the destructuring syntax to retrieve the values for `{first, second, catcher}` from `megaObj`.
## Async / Await
## Async / await
Note the following code in index.ts: