Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialANOOSHA CHIKKULAPALLI
3,152 Pointsloops
i couldn't run this.
numbers = []
number = 0
numbers.push(number)
loop do
number+=1
break if numbers.count==3
end
end
# write your loop here
1 Answer
Kourosh Raeen
23,733 PointsYou have an extra end keyword. Also, you need to add the number to the array inside the loop right after incrementing it:
numbers = []
number = 0
# write your loop here
loop do
number+=1
numbers.push(number)
break if numbers.count==3
end