You'd need to iterate through them, but if you're exclusively using
the id to retrieve them you could use this:

     var TESTS = {
         "1": {
             id: 1,
             name: 'Test 1',
         },
         "2": {
             id: 2,
              name: 'Test 2',
         }
     };

var theone = TESTS[someid];

That is, use an object and retrieve the elements using the ID property.

Reply via email to