Changing [].flatten to array wrapper method

Changing [].flatten to array wrapper method

       [[1,2,3]].flatten <=> Array([1,2,3])   =>  [1,2,3]
       [1].flatten    <=>   Array(1)    => [1]

And this will avoid the nil value
       
       [nil].flatten   => [nil]
       Array(nil)    =>  []