Created
January 12, 2022 19:58
-
-
Save rahulbanerjee26/805e5fc8a8d607b5d8b4631ae2763d7c 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
//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