Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Conversation

@rahul-tapali
Copy link

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)    =>  []

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants