summaryrefslogtreecommitdiffstats
path: root/tsapp1/src/user.ts
blob: 353fd441a16d3341b6bfbd88b1f404d7256dd627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);