Comment

Comment by klochner

Confident coding comes from understanding the language.

  Array({:foo=>1}).map{|h| h[:foo]}
  TypeError: Symbol as array index

  [{:foo=>1}].flatten.compact.map{|h| h[:foo]}
   => [1]
parent klochner 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton