Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: Test your Ruby Blocks knowledge with this quiz we built.
irb(main):001:0> data = [1,2] => [1, 2] irb(main):002:0> total = 10 => 10 irb(main):003:0> data.each { |x| total += x } => [1, 2] irb(main):004:0> puts total 13 => nil
What is proper syntax for a block? A. { |x| puts x } B. do |x| puts x end C. ->(x) { puts x} D. A & B E. B & C F. A & C
You might want to read this and rewrite your quiz...
http://awaxman11.github.io/blog/2013/08/05/what-is-the-diffe...
There are no comments on this comment yet.
You might want to read this and rewrite your quiz...
http://awaxman11.github.io/blog/2013/08/05/what-is-the-diffe...