Elastic interview question

Flattening a Nested javascript object to an array structure.