I have a JavaScript code like that:
var faqOpener = {
defaults: {
idSelector: "#id",
id: "2"
},
...
if (options && !jQuery.isEmptyObject(options))
$.extend(this.defaults, options);
...
How can I convert that variable as an array of literal arrays something like:
var faqOpener = {
defaults[]: {
idSelector: "#id",
id: "2"
},
...
EDIT: I will use that defaults variable from another javascript code. As shown in the example it has only one element at array of literal arrays however I should define it correctly and will able to pass variable length(for example array of literal arrays that has 3 array or 1 or more it depends) array of literal arrays.