Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 242 Bytes

flatten.md

File metadata and controls

12 lines (9 loc) · 242 Bytes

Implement Flatten Arrays. Given an array that may contain nested arrays, give a single resultant array.

function flatten(input){ }

Example:

Input: var input = [2, 1, [3, [4, 5], 6], 7, [8]]; flatten(input); Output: [2, 1, 3, 4, 5, 6, 7, 8]