Created
January 12, 2022 20:05
-
-
Save rahulbanerjee26/f9e941308b81d4e2563a7c289c97ba58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface userType{ | |
id: number, | |
name: string, | |
email: string, | |
age?:number | |
} | |
let user: userType = { | |
id: 10, | |
name:'Rahul', | |
email:'a@g.com', | |
} | |
console.log(user.id) | |
// 10 | |
let user1: userType ={ | |
id: 11, | |
name: 'Rahul', | |
email: 'a@g.com' | |
} | |
console.log(user1.id) | |
// 11 | |
let user2: userType ={ | |
id: 12, | |
name: 'R', | |
email: 'q@y.com', | |
age: 20 | |
} | |
console.log(user2.id) | |
// 12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment