Skip to content

Commit 493b365

Browse files
Update arrays.js
For function getName(), the parameter should be an array of arrays, since the function utilize find() method. The original parameter "dog" may imply that the method takes a dog object - which will cause an error Error: dog.find is not a function
1 parent 8e24751 commit 493b365

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arrays/arrays/arrays.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ const dogPair = [
8686
['color', 'black'],
8787
];
8888

89-
function getName(dog) {
90-
return dog.find(attribute => {
89+
function getName(dogPair) {
90+
return dogPair.find(attribute => {
9191
return attribute[0] === 'name';
9292
})[1];
9393
}

0 commit comments

Comments
 (0)