[123, "test"]" /> Tell Me How Do You Remove Nil Values In Array Using Ruby? [123, "test"]" /> [123, "test"]" />
Answers

Question and Answer:

  Home  Ruby Developer

⟩ Tell me how do you remove nil values in array using ruby?

Array#compact removes nil values.

Example:

>> [nil,123,nil,"test"].compact

=> [123, "test"]

 120 views

More Questions for you: