Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, December 17, 2012

LearnStreet Sample Solution to Lesson 9 Exercise 3



numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]

# your code here
numbers.collect! do |x|
    if x % 2 != 0
        x
    else
        nil
    end  
end

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts