Skip to content

Instantly share code, notes, and snippets.

@ilhamgusti
Created March 1, 2021 11:05
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 ilhamgusti/99cb89d47e913f3d41170daee6126f2f to your computer and use it in GitHub Desktop.
Save ilhamgusti/99cb89d47e913f3d41170daee6126f2f to your computer and use it in GitHub Desktop.
Map()
/**
*
* @param map Map data
* @param searchValue value
*/
export function getByValue(map: any[], searchValue: any): any {
for (const [key, value] of map.entries()) {
if (value === searchValue) return key;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment