We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd145b4 commit 977e6ddCopy full SHA for 977e6dd
lesson2/functions.ts
@@ -0,0 +1,11 @@
1
+const add = (a: number, b: number) => {
2
+ return a + b;
3
+};
4
+
5
+// No type annotations here, but TypeScript can spot the bug
6
+const names = ["Alice", "Bob", "Eve"];
7
8
+// Contextual typing for function
9
+names.forEach(function (s) {
10
+ console.log(s.toUpperCase());
11
+});
0 commit comments