Skip to content

Instantly share code, notes, and snippets.

@timhettler
Created October 7, 2020 04:00
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 timhettler/ea31e4b750899ada79de8f86f5ee522b to your computer and use it in GitHub Desktop.
Save timhettler/ea31e4b750899ada79de8f86f5ee522b to your computer and use it in GitHub Desktop.
Create a look up for a table with key value pairs
function pivotTable(table) {
const map = new Map();
table.forEach(row => { map.set(row.key, row.value); })
return map
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment