Skip to content

Instantly share code, notes, and snippets.

@meekg33k
Last active January 17, 2020 17:16
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 meekg33k/f0abcf17f4753173ef63bf926d3f15ff to your computer and use it in GitHub Desktop.
Save meekg33k/f0abcf17f4753173ef63bf926d3f15ff to your computer and use it in GitHub Desktop.
Identity function for different types https://medium.com/p/177b4a654ef6
const identityStringFn = (arg: string): string => arg;
const identityNumberFn = (arg: number): number => arg;
const identityBooleanFn = (arg: boolean): boolean => arg;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment