Show HN: Test your Ruby Blocks knowledge with this quiz we built (rubyquiz.bottega8.com) 1 points by rishtal 11y ago ↗ HN
[–] hackerboos 11y ago ↗ Some of your questions are wrong: 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 I answered A & B which your quiz says is wrong.You might want to read this and rewrite your quiz...http://awaxman11.github.io/blog/2013/08/05/what-is-the-diffe...
1 comment
[ 0.21 ms ] story [ 15.0 ms ] threadYou might want to read this and rewrite your quiz...
http://awaxman11.github.io/blog/2013/08/05/what-is-the-diffe...