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

Changing [].flatten to array wrapper method #977

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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