Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created January 12, 2022 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulbanerjee26/f9e941308b81d4e2563a7c289c97ba58 to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/f9e941308b81d4e2563a7c289c97ba58 to your computer and use it in GitHub Desktop.
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