Skip to content

Commit e903450

Browse files
committed
changed the name of the parameter
1 parent 0dddbf3 commit e903450

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sprint-2/implement/lookup.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
// the keys of the object should be the first element of each inner array (country code)
55
// the values of the object should be the second element of each inner array (currency code)
66

7-
function Lookup(coCuPairs) {
7+
function Lookup(countryCurrencyPairs) {
88
// check if the argument is an array of arrays
99
if (
10-
Array.isArray(coCuPairs) &&
10+
Array.isArray(countryCurrencyPairs) &&
1111
// check if each inner array is an array.
12-
coCuPairs.every((pair) => Array.isArray(pair)) &&
12+
countryCurrencyPairs.every((pair) => Array.isArray(pair)) &&
1313
// check if each inner array has two elements.
14-
coCuPairs.every((pair) => pair.length === 2)
14+
countryCurrencyPairs.every((pair) => pair.length === 2)
1515
// we can also use index to check the pair is an array as follows:
16-
// for (let i = 0; i < coCuPairs.length; i++)
17-
// return Array.isArray(coCuPairs[i])
16+
// for (let i = 0; i < countryCurrencyPairs.length; i++)
17+
// return Array.isArray(countryCurrencyPairs[i])
1818
) {
19-
return Object.fromEntries(coCuPairs);
19+
return Object.fromEntries(countryCurrencyPairs);
2020
}
2121
return "Invalid input: expected an array of arrays";
2222
}

Sprint-2/implement/lookup.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Example
3636
Given: [['US', 'USD'], ['CA', 'CAD']]
3737
3838
When
39-
Lookup(coCuPairs) is called
39+
Lookup(countryCurrencyPairs) is called
4040
4141
Then
4242
It should return:

0 commit comments

Comments
 (0)