Ad
Algorithms
Logic
Code
Diff
  • const flatten = a => [].concat.apply([], a)
    • const flatten = arr =>
    • arr.reduce((acc, item) => Array.isArray(item) ? [...acc, ...flatten(item)] : [...acc, item], []);
    • const flatten = a => [].concat.apply([], a)