Welcome to the Treehouse Community
Looking to learn something new?
What is wrong with my answer?
I dont understand why this is wrong.
class TodoList attr_reader :name, :todo_items def initialize(name) @name = name @todo_items =  end def add_item(name) todo_items.push(TodoItem.new(name)) end def empty? if(@todo_items.length == 0) return true else return false end end
thanks I don't know why I didn't notice that.
William LiCourses Plus Student 26,867 Points
though not related, I'd like point out that you can shorten your
empty? method like this:
def empty? @todo_items.length==0 end
And it behaves exactly the same.