Skip to content

Commit 10aedc0

Browse files
authored
Create generics.ts
1 parent 4e25f2b commit 10aedc0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

generics.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function identity<T>(arg: T): T {
2+
return arg;
3+
}
4+
5+
let str = identity("hello");
6+
let num = identity(5);
7+
8+
console.log(str);
9+
console.log(num);

0 commit comments

Comments
 (0)