Elastic Interview Question

Flattening a Nested javascript object to an array structure.