Salesforce Interview Question

Flatten a nested array in javascript