• +91 9723535972
  • info@interviewmaterial.com

Ruby Interview Questions and Answers

Question - How do you remove nil values in array using ruby?

Answer -

Array#compact removes nil values.

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

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners