Skip to content

Instantly share code, notes, and snippets.

@jbmilgrom
Created August 27, 2019 20:41
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 jbmilgrom/09691a2870b99ca1c1ca664bce82d569 to your computer and use it in GitHub Desktop.
Save jbmilgrom/09691a2870b99ca1c1ca664bce82d569 to your computer and use it in GitHub Desktop.
"Sameness" in the context of immutability
enum PrimaryColor {
Red = "RED",
Yellow = "YELLOW",
Blue = "BLUE"
}
const green1 = [
{ color: PrimaryColor.Yellow, weight: 1 / 2 },
{ color: PrimaryColor.Blue, weight: 1 / 2 }
] as const;
const green2 = [
{ color: PrimaryColor.Yellow, weight: 1 / 2 },
{ color: PrimaryColor.Blue, weight: 1 / 2 }
] as const;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment