I am trying to recursively turn a nested array into an ordered HTML list.
My test array looks like: [['A','B','C'],['D',['E','F','G']]]
And the result should look like:
- A
- B
- C
- D
- E
- F
- G
But it is currently returning:
- A
- B
- C
- D
- E,F,G
When I print it out, the recursion is successful, but gets overwritten by the previous step. I feel like it has to do with declaring the string at the top of the function, but I am not sure how else to approach it.
JSFIDDLE: https://jsfiddle.net/nzyjoawc/2/