I have an object that holds alerts and some information about them:
var alerts = {
1: { app: \'helloworld\', message: \'message\' },
2: { app: \'hel
You should really go with the array of alerts suggestions, but otherwise adding to the object you mentioned would look like this:
alerts[3]={"app":"goodbyeworld","message":"cya"};
But since you shouldn't use literal numbers as names quote everything and go with
alerts['3']={"app":"goodbyeworld","message":"cya"};
or you can make it an array of objects.
Accessing it looks like
alerts['1'].app
=> "helloworld"