100AlgorithmsChallenge/flattenArray at master · IAmHKrishna/100AlgorithmsChallenge · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

Check Out My YouTube Channel


Flatten a nested array. You must account for varying levels of nesting.

Example

  • steamrollArray([ [ ["a"]], [ ["b"]]]) should return ["a", "b"].

  • steamrollArray([1, [2], [3, [ [4]]]]) should return [1, 2, 3, 4]

Hints

  • isArray()
  • push()