Skip to content

Commit 5567875

Browse files
Alex JamshidiAlex Jamshidi
authored andcommitted
added solution to lookup.js
1 parent 40a2e86 commit 5567875

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Sprint-2/implement/lookup.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
function createLookup() {
2-
return {'US': 'USD', 'CA': 'CAD', 'UK': 'GBP'}
1+
function createLookup(arrayOfArrays) {
2+
const lookup = {}
3+
for (array of arrayOfArrays) {
4+
lookup[array[0]] = array[1];
5+
}
6+
return lookup
37
}
48

59
module.exports = createLookup;

0 commit comments

Comments
 (0)