Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions questions/zipObj-a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function zipObj(list1, list2) {
return list1.reduce((result, curr, index) => {
result[curr] = list2[index];
return result;
}, {});
}
3 changes: 3 additions & 0 deletions questions/zipObj.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//write a function that returns a new object out of a list of keys and a list of values

//zipObj(['a', 'b', 'c'], [1, 2, 3]) {a: 1, b: 2, c: 3}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the sample output?