From d0603118ab6d03db691de7ef628e827a273ff5e4 Mon Sep 17 00:00:00 2001 From: Penchy Date: Thu, 20 Jan 2022 20:05:27 +0000 Subject: [PATCH] Fixed double quote typo in description --- .../en/handbook-v2/Type Manipulation/Template Literal Types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md index df550a1dda54..db59acc8f160 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md @@ -166,7 +166,7 @@ person.on("ageChanged", newAge => { Here we made `on` into a generic method. -When a user calls with the string `"firstNameChanged'`, TypeScript will try to infer the right type for `Key`. +When a user calls with the string `"firstNameChanged"`, TypeScript will try to infer the right type for `Key`. To do that, it will match `Key` against the content prior to `"Changed"` and infer the string `"firstName"`. Once TypeScript figures that out, the `on` method can fetch the type of `firstName` on the original object, which is `string` in this case. Similarly, when called with `"ageChanged"`, TypeScript finds the type for the property `age` which is `number`.