From 5e94d7d758eb19f19ab44034193e996cb859abea Mon Sep 17 00:00:00 2001 From: Aaron Greenlee Date: Sun, 5 Aug 2018 13:07:51 -0400 Subject: [PATCH] Added missing word within Type Assertions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 263ffe0..a83318d 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ This is a useful way of telling TypeScript what the real type of an expression i The reason we need to do so in this case is that `getElementById`'s return type is `HTMLElement | null`. Put simply, `getElementById` returns `null` when it can't find an element with a given `id`. -We're assuming that `getElementById` will actually succeed, so we need convince TypeScript of that using the `as` syntax. +We're assuming that `getElementById` will actually succeed, so we need to convince TypeScript of that using the `as` syntax. TypeScript also has a trailing "bang" syntax (`!`), which removes `null` and `undefined` from the prior expression. So we *could* have written `document.getElementById('root')!`, but in this case we wanted to be a bit more explicit.