Skip to content

Instantly share code, notes, and snippets.

@imkrish
Last active April 20, 2019 11:49
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 imkrish/16b5c8498237d3247149e7cde1d2cd0d to your computer and use it in GitHub Desktop.
Save imkrish/16b5c8498237d3247149e7cde1d2cd0d to your computer and use it in GitHub Desktop.
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