Please see this repl.
Notice that it has tests that are being run against the function.
I'm enrolled at Thinkful, and I'm having a lot of trouble.
I spent over an hour trying to come up with something to make this code work, and over four hours trying to understand the solution once I had to give up.
If you notice my comments, I'm pretty flustered. How does JS (and I) know what to do with
items? I just don't see how they're doing what they're doing.
.id is the key from the array, and
idNum is the value for
.id key. But how does this function know that? Or how does it tell JS?
If I don't understand that basic principal, I don't know how I'll ever write a proper function.