Skip to content

Commit bdcc0fc

Browse files
author
JorvanW
committed
updated answers for invert.js
1 parent 37deb3c commit bdcc0fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Sprint-2/interpret/invert.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ function invert(obj) {
2525
// {"1": "a", "2":"b"}
2626

2727
// c) What does Object.entries return? Why is it needed in this program?
28-
// It returns an array of property into the object
28+
// Object Entries return an array of key value pairs and it's needed so the for...of loop goes through each key and value individually
2929

3030
// d) Explain why the current return value is different from the target output
3131
// The current return value only shows {key: 2}. It doesn't show the first key and value only the second,
32-
// and it doesn't specify the second key. Its just defined as 'key'.
32+
// and it doesn't specify the second key. Its just defined as 'key'. It also doesn't swap the key and value around as intended
3333

3434
// e) Fix the implementation of invert (and write tests to prove it's fixed!)
3535

0 commit comments

Comments
 (0)