Tell me how do you remove nil values in array using ruby?
Answer / Gaurav Krishan
"In Ruby, you can remove all nil elements from an array by calling the compact method on it. Example: arr = [1,nil,2,nil].compact will return [1,2]."
| Is This Answer Correct ? | 0 Yes | 0 No |
What does mri most commonly stand for?
How is object methods defined in ruby?
How to create ruby object?
What is the use of global variable $ in Ruby?
What is the use of interpolation in ruby?
Difference between nil and false in ruby?
What are advantages of using ruby?
what is Interpolation in Ruby?
In how many ways you can compare Ruby string?
What are the different uses of ruby modules?
Please explain what is mvc and why do we use it?
How is class methods defined in ruby?