Created
October 7, 2020 04:00
-
-
Save timhettler/ea31e4b750899ada79de8f86f5ee522b to your computer and use it in GitHub Desktop.
Create a look up for a table with key value pairs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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