❇ flatten-deeply-nested-array👌 🏆O(N)❤️ Javascript❤️ Memory👀95.45%🕕 Meaningful Vars✍️ 🔴🔥 ✅ 👉
\nvar flat = function (arr, n, tempArray = [], currentCycle = 0) {\n    for (let index = 0; index < arr.length; index++) {\n        if (Array.isArray(arr[index]
```\nvar flat = function (arr, n, tempArray = [], currentCycle = 0) {\n    for (let index = 0; index < arr.length; index++) {\n        if (Array.isArray(arr[index]) && currentCycle < n) {\n            flat(arr[index], n, tempArray, currentCycle + 1)\n        } else {\n            tempArray.push(arr[index])\n        }\n    }\n    return tempArray\n};\n```
['JavaScript']