Check out example codes for "rails filter hashes by key value". It will help you in understanding the concepts better.

Code Example 1

> { one: 1, two: 2, three: 3 }.slice(:one, :two)
=> {:one=>1, :two=>2}

Code Example 2

{ :a => 1, :b => 2, :c => 3 }.select { |k, v| k != :a && v.even? } # => { :b => 2 }

Learn ReactJs, React Native from akashmittal.com