Lodash Implement _.invert()!

invert(object) { let invertedObject = {}; for (const key in object) { const originalValue = object[key]; invertedObject = {originalValue: key}; } return invertedObject; }

Hi guys, i’m stuck on the invert method for the lodash project. I have looked at the get unstuck video, and my code still doesn’t pass the final test .

1 - _.invert() is defined - Passed!
2 - Returns an object with key and value inverted for a single key-value pair - Passed!
3 - Original key is not present after the key-value pairs have been inverted - Passed!
4 - Returns an object with all keys and values inverted - Failed: _.invert({originalKey: “originalValue”})[“originalKey”]) returned undefined instead of anotherKey.

Can anyone help me out ?? Thanks :wink:

Without blaming, and without taking the time to go through the video, anybody would have seen that assignment replaces; it does not augment. First clue.