In Go, developers use maps all the time. They're the only reasonable choice you're given for a dynamic key/value store.
In JavaScript, you have two options: objects and maps, and honestly, I still use objects more often than maps just because the syntax is so simple. That said, there are some advantages to using maps:
for [key, value] of myMap to loop over them. Objects are not (without some extra work).__proto__ or constructor that you might not want.All this to say, in most cases either will work for your KV needs, but it's important to understand some of the benefits of maps.
Textio discovered a nasty bug: the intern creating the user map set objects (with fname and lname properties) as keys in our user map instead of string keys. Now we can't look up users... big problem!
Complete the fixUserMap function. It takes a Map with object keys mapping to user objects and returns a new fixed Map with string keys.
For example
const grossMap = new Map([
[
{ fname: "Eren", lname: "Yeager" },
{ fname: "Eren", lname: "Yeager", tags: ["Survey Corps", "Titan Slayer"] },
],
]);
const fixedMap = fixUserMap(grossMap);
console.log(fixedMap);
// Map { 'Eren Yeager' => { fname: 'Eren', lname: 'Yeager', tags: [ 'Survey Corps', 'Titan Slayer' ] } }