UNPKG
@ahsolo/lotide
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
lotide assignment for Lighthouse Labs coding bootcamp
github.com/ahSOLO/lotide
ahSOLO/lotide
@ahsolo/lotide
/
flattenRecursive.js
15 lines
(13 loc)
•
282 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const flatRecursion =
function
(input, output)
{
if
(Array.isArray(
input
)) {
for
(let ele of
input
) { flatRecursion(ele,
output
); console.
log
(ele); } }
else
{ console.
log
(
"Input"
,
input
);
output
.push(
input
); } }
module
.exports = flatRecursion;