We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21e1adc commit 9e7a052Copy full SHA for 9e7a052
Sprint-2/implement/lookup.js
@@ -1,5 +1,16 @@
1
-function createLookup() {
+function createLookup(pairs) {
2
// implementation here
3
+ // Creates empty object that will store our,
4
+ // country → currency
5
+ const lookup = {};
6
+ // Loop through each pair in the input array
7
+ for (const [country, currency] of pairs) {
8
+ // Use the country code as they key
9
+ // Assigns the correspoding currency code as the value
10
+ lookup[country] = currency;
11
+ }
12
+ // returns the completed lookup object
13
+ return lookup;
14
}
15
16
module.exports = createLookup;
0 commit comments