Last active
April 20, 2019 11:49
-
-
Save imkrish/16b5c8498237d3247149e7cde1d2cd0d 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 User { | |
readonly id: number; | |
name: string; | |
} | |
const user: User = { | |
id: 1, | |
name: "Keerati" | |
}; | |
user.id++; // cannot assign to 'id' because it is a read-only property. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment