From 5fc508e91d490b0f66d799ada541c3ac3ddfaa13 Mon Sep 17 00:00:00 2001
From: Denny Biasiolli
Date: Tue, 1 Oct 2019 19:18:29 +0200
Subject: [PATCH 1/2] fixing typo in Inference example comment
Ref #20
---
chapters/More on Functions.md | 4 ++--
docs/chapters/more-on-functions/index.html | 4 ++--
docs/everything/index.html | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/chapters/More on Functions.md b/chapters/More on Functions.md
index cf380f7..11aec14 100644
--- a/chapters/More on Functions.md
+++ b/chapters/More on Functions.md
@@ -128,8 +128,8 @@ function map(arr: E[], func: (arg: E) => O): O[] {
return arr.map(func);
}
-// Parameter 'n' is of type 'number'
-// 'parsed' is of type 'string[]'
+// Parameter 'n' is of type 'string'
+// 'parsed' is of type 'number[]'
const parsed = map(["1", "2", "3"], n => parseInt(n));
```
diff --git a/docs/chapters/more-on-functions/index.html b/docs/chapters/more-on-functions/index.html
index 93a7d2c..dfebeca 100644
--- a/docs/chapters/more-on-functions/index.html
+++ b/docs/chapters/more-on-functions/index.html
@@ -100,8 +100,8 @@
return arr.map(func);
}
-// Parameter 'n' is of type 'number'
-// 'parsed' is of type 'string[]'
+// Parameter 'n' is of type 'string'
+// 'parsed' is of type 'number[]'
const parsed = map(["1", "2", "3"], n => parseInt(n));Try
Note that in this example, TypeScript could infer both the type of the E
type parameter (from the given string
array), as well as the type O
based on the return value of the function expression.
diff --git a/docs/everything/index.html b/docs/everything/index.html
index 5572757..46d5468 100644
--- a/docs/everything/index.html
+++ b/docs/everything/index.html
@@ -1177,8 +1177,8 @@
return arr.map(func);
}
-// Parameter 'n' is of type 'number'
-// 'parsed' is of type 'string[]'
+// Parameter 'n' is of type 'string'
+// 'parsed' is of type 'number[]'
const parsed = map(["1", "2", "3"], n => parseInt(n));Try
Note that in this example, TypeScript could infer both the type of the E
type parameter (from the given string
array), as well as the type O
based on the return value of the function expression.
From 75e5e366895a2610214a7f6126a88609f3a31308 Mon Sep 17 00:00:00 2001
From: Denny Biasiolli
Date: Tue, 1 Oct 2019 19:20:28 +0200
Subject: [PATCH 2/2] fixing typo in compiler options docs
Ref #24
---
docs/reference/compiler-options/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/reference/compiler-options/index.html b/docs/reference/compiler-options/index.html
index a201e5a..180b401 100644
--- a/docs/reference/compiler-options/index.html
+++ b/docs/reference/compiler-options/index.html
@@ -631,7 +631,7 @@ In TypeScript, you can import a type and then subsequently import it:
+
In TypeScript, you can import a type and then subsequently export it:
import { someType, someFunction } from "someModule";
someFunction();