Skip to content

Nobledsmarts/Steamroller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Steamroller

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

Tests

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

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

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

steamrollArray([1, {}, [3, [[4]]]]) should return [1, {}, 3, 4]

Your solution should not use the Array.prototype.flat() or Array.prototype.flatMap() methods

Global variables should not be used

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy