summaryrefslogtreecommitdiffstats
path: root/tsapp1/src/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tsapp1/src/user.ts')
-rw-r--r--tsapp1/src/user.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/tsapp1/src/user.ts b/tsapp1/src/user.ts
new file mode 100644
index 0000000..353fd44
--- /dev/null
+++ b/tsapp1/src/user.ts
@@ -0,0 +1,17 @@
+interface User {
+ name: string;
+ id: number;
+}
+
+class UserAccount {
+ name: string;
+ id: number;
+
+ constructor(name: string, id: number) {
+ this.name = name;
+ this.id = id;
+ }
+}
+
+const user: User = new UserAccount("Kyle", 1);
+console.log("username is %s and userid is %d", user.name, user.id); \ No newline at end of file