|
Javascript / Merge 2 structures while preserving index namesHi, i'm using a nice little javascript to merge multiple structures. While the patch is working great (thanks to cwright !), it doesn't RETAIN ORIGINAL index NAMES .... making it rather useless... Any help would make my day. Here's the JS: var result = new Object(); function (__structure outStruct) main (__structure inputStruct[3]) { result.outStruct = new Object(); var i = 0; for(item in inputStruct[0]) result.outStruct[""+i++] = inputStruct[0][item]; for(item in inputStruct[1]) result.outStruct[""+i++] = inputStruct[1][item]; for(item in inputStruct[2]) result.outStruct[""+i++] = inputStruct[2][item]; return result; } |
Can you supply a sample composition, and some sample inputs/expected outputs?
here's an example. Output structure should show indexes named "foo" and "bar". It actually doesn't.
the other example is what i'm trying to achieve.
sorted:
for those interested, I've just released a QCplugin that does the job.
1024 blog