I have a array that looks like the following:

I would like to add a new item, named "attributes", which is also an array. I can I do that?
Thanks.
var test = [{
enabled: true,
key: 'FIN28',
text: 'Service Agreement'
}, {
enabled: true,
key: 'test',
text: 'test test'
}];
for (var i = 0; i < test.length; i++) {
test[i]['attributes'] = [];
}
console.log(test);
attibutes is an array of objects?According to your comment, you want to add an attribute named "attribute" to the object inside your array. you can do it like this :
myarray[0].attribute = myvalue;
If you want to do it for every item of your array, you can do this :
for(var idx in myarray)
myarray[idx].attribute = myvalue;
arr[0].attributes = myArray. Use a for loop if you want to add attributes to each item.