Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit d8dab32

Browse files
Merge pull request #175 from aarongreenlee/patch-1
Added missing word within Type Assertions area of readme
2 parents 9df982f + 5e94d7d commit d8dab32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ This is a useful way of telling TypeScript what the real type of an expression i
243243

244244
The reason we need to do so in this case is that `getElementById`'s return type is `HTMLElement | null`.
245245
Put simply, `getElementById` returns `null` when it can't find an element with a given `id`.
246-
We're assuming that `getElementById` will actually succeed, so we need convince TypeScript of that using the `as` syntax.
246+
We're assuming that `getElementById` will actually succeed, so we need to convince TypeScript of that using the `as` syntax.
247247

248248
TypeScript also has a trailing "bang" syntax (`!`), which removes `null` and `undefined` from the prior expression.
249249
So we *could* have written `document.getElementById('root')!`, but in this case we wanted to be a bit more explicit.

0 commit comments

Comments
 (0)