Javascript recursive function that flats an array full of array inside them.