every time I do the node test/invert.js, I pass all the tests except the last one it says: 4 - Returns an object with all keys and values inverted - Failed: _.invert ({originalKey: “originalValue”}) [“originalKey”]) returned undfined instead of anotherKey
I watched the walk through video and changed my code to that, but it still wont work. here’s my code:
invert(object){
let invertedObject = {};
for(let key in object){
const originalValue = object[key];
invertedObject = {originalValue : key};
}
return invertedObject;
},
please help me