Ruby - Loops and Iteration
What is wrong with this Ruby code snippet?
items = [1, 2, 3] items.each do item puts item * 2 end
items = [1, 2, 3] items.each do item puts item * 2 end
each do blockdo with each, the block variable must be inside pipes: do |item|.item, causing a syntax error.|item| -> Option D| | [OK]| | with each do [OK]do is invalid with eacheach is wrong15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions