Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created January 12, 2022 19:58
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/805e5fc8a8d607b5d8b4631ae2763d7c to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/805e5fc8a8d607b5d8b4631ae2763d7c to your computer and use it in GitHub Desktop.
//Declaring object with the type object
let user:Object = {
id: 10,
name: 'Rahul',
email: 'a@g.com'
}
console.log(user.name)
// error TS2339: Property 'name' does not exist on type 'object'.
user.age = 20
// error TS2339: Property 'age' does not exist on type 'object'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment