I have a collection that looks like:
var stuff = new Array();
stuff["col1"] = new Array(
"key", "value",
"key2", value2"
);
And other one that looks like:
var fun = {
"key": "value",
"key2": "value2"
}
I need to loop through each one, and output something like:
INSERT Table1 (c1, c2) VALUES (key, value)
Where the values ‘key’ and ‘value’ are coming from the javascript arrays.
(btw, are they both arrays or?)
Actually
stuff["col1"]creates an object and stores an array withcol1as the key. The code is fine.This loops through both the array and the object: