summaryrefslogtreecommitdiffhomepage
path: root/typescript.html.markdown
diff options
context:
space:
mode:
authorBoris Verkhovskiy <boris.verk@gmail.com>2024-04-18 21:34:40 -0700
committerBoris Verkhovskiy <boris.verk@gmail.com>2024-04-18 22:24:06 -0700
commitbaf63b1f0838fc078f0221bdeb2cf12baeccf6c2 (patch)
tree211b6fcb630410124db0580709325e20a28eaa87 /typescript.html.markdown
parent51ff67f3a99aab1d001ecb75773daeeffecd406e (diff)
[typescript/*] remove dead links and format
Diffstat (limited to 'typescript.html.markdown')
-rw-r--r--typescript.html.markdown14
1 files changed, 7 insertions, 7 deletions
diff --git a/typescript.html.markdown b/typescript.html.markdown
index 6346a986..f8e78d44 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -227,7 +227,7 @@ moreNumbers.length = 3; // Error, length is read-only
numbers = moreNumbers; // Error, mutating methods are missing
// Tagged Union Types for modelling state that can be in one of many shapes
-type State =
+type State =
| { type: "loading" }
| { type: "success", value: number }
| { type: "error", message: string };
@@ -275,11 +275,11 @@ let foo = {} // Creating foo as an empty object
foo.bar = 123 // Error: property 'bar' does not exist on `{}`
foo.baz = 'hello world' // Error: property 'baz' does not exist on `{}`
-// Because the inferred type of foo is `{}` (an object with 0 properties), you
+// Because the inferred type of foo is `{}` (an object with 0 properties), you
// are not allowed to add bar and baz to it. However with type assertion,
// the following will pass:
-interface Foo {
+interface Foo {
bar: number;
baz: string;
}
@@ -290,7 +290,7 @@ foo.baz = 'hello world'
```
## Further Reading
- * [TypeScript Official website] (http://www.typescriptlang.org/)
- * [TypeScript language specifications] (https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md)
- * [Learn TypeScript] (https://learntypescript.dev/)
- * [Source Code on GitHub] (https://github.com/Microsoft/TypeScript)
+
+* [Official TypeScript website](https://www.typescriptlang.org/)
+* [Source code on GitHub](https://github.com/microsoft/TypeScript)
+* [Learn TypeScript](https://learntypescript.dev/)