This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.length will give you the number of top-level elements in an array. | |
Your task is to create a function deepCount that returns the number of ALL elements within an array, including any within inner-level arrays. | |
For example: | |
deepCount([1, 2, 3]); | |
//>>>>> 3 | |
deepCount(["x", "y", ["z"]]); | |
//>>>>> 4 |
NewerOlder