Currently, I have a collection of key-value pairs that need to be stored in another array. However, I am facing difficulties with the logic as I am unable to keep track of which keys-values have already been assigned while iterating over the list of objects.
var kv={"a":2,"b":1,"c":1};
var list_of_objects=[bob,bill,jane,joe];//these are objects
The Objective
bob.kv="a"
bill.kv="a"
jane.kv="b"
joe.kv="c"
Additional Information: The property kv
belongs to individual objects such as bob, bill, jane, or joe.