Javascript Nested object to multidimensional array recursive function
问题 Ok here's one at which I've been scratching my head at without great success so far; Sorry in advance for the very long question... I am using this Lucene Query Parser to parse a string/query which produce this kind of data structure: // Notice that the repetition of 'field3' is on purpose Sample String: field1:val1 AND field2:val2 OR field3:val3 AND field3:val4 Result: { left: { field: "field1", term: "val1" }, operator: "AND" right: { left: { field: "field2", term: "val2" }, operator: "OR"