The problem
Given any list xs, where xs could contain other lists or any non-list values, we wish to extract all the values in xs. For e...
For further actions, you may consider blocking this person and/or reporting abuse
In order to understand recursion one must understand recursion.
my favourite quote of all time!
Hi!
PHP do not have native functions for flatten.
Link below, my php functions:
gist.github.com/s3b4stian/0e2e638a...
What do you think about my solution? Flatten an array in JavaScript
It is interesting! There are a few points about your solution:
Array.isArray()
(here)reducer
function.If I were going to define
flatten
with reduce, I would have written something like the following: