{name1:"John", name2:"Peter", name3:"Tom"}

Hi guys,

Just like the meaningless title says, I have this variable:

var a = {name1:“John”, name2:“Peter”, name3:“Tom”}

Now you see, I don’t know where it stops. In the latter, I had 3 names. But I might have 4, or 5, or 6, based on a variable “num” … so I need to have some sort of code that dynamically creates var a for me.

Any ideas?