-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjects.ts
62 lines (52 loc) · 1.06 KB
/
objects.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// const User = {
// name: "Narcis",
// email: "[email protected]",
// isActive: true
// }
//
// function createUser({name: string, isPaid: boolean}){}
//
// let newUser = {name: "Narcis", isPaid: false, email: "[email protected]"}
// createUser(newUser)
//
//
//
// function createCourse():{name: string, price: number}{
// return {name: "Narcis", price: 399}
// }
// type User = {
// name: string;
// email: string;
// isActive: boolean
// }
//
// function creatUser(user: User) : User{
// return {name: "", email: "", isActive: true}
// }
//
// creatUser({name: "", email: "", isActive: true})
type User = {
readonly _id: string
name: string;
email: string;
isActive: boolean
credCardDetails?: number
}
let myUser: User = {
_id: "12345",
name: "h",
email: "[email protected]",
isActive: false
}
type cardsNumber = {
cardNumber: string
}
type cardDate = {
cardDate: String
}
type cardDetails = cardsNumber & cardDate & {
cvv: number
}
myUser.email = "[email protected]"
// myUser._id = "asa"
export {}