I have an array of objects, each object has an unique id and I want to link multiple (sometimes hundreds) extensions to an object linked by it's id.
Here a psuedo code example:
var objects = [
{id:15,name:"client John Doe"},
{id:28,name:"server"}
]
var extensions = [
28:[
{
name:"watch errors",
command: "tail -f error.log"
},
{
name:"clear errors",
command: "> error.log"
}
]
]
This is not valid javascript, what is the best alternative to create an numeric associative array?