Dynamic object in function

Based on a function like this. How can I make the names fred, mary, sarah dynamic and expand/bild it based on a incoming nameArray?

var myObj = {
fred: { v: 2, q: 4, t: 7},
mary: { v: 0, q: 10, t: 0},
sarah: { v: 0, q: 0, t: 0}
}

msg = myObj;

return msg;

so you want to add a key/value to a javascript object?? I wonder if you could google that??

Googling with the correct queries often help.

Thank you :slight_smile: