Skip to content

Instantly share code, notes, and snippets.

@EricDykstra
Last active December 15, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricDykstra/5259713 to your computer and use it in GitHub Desktop.
Save EricDykstra/5259713 to your computer and use it in GitHub Desktop.
Phase 1 Assessment Review
## enumerable methods ##
p [1,2,3,4,5].each { |x| x * 2 } == [] #put the output here to make it return true
p [1,2,3,4,5].map { |x| x * 2 } == []
p [1,2,3,4,5].select { |x| x % 2 == 0 } == []
## hashes ##
hash = {1 => 2, [99,99] => "fifty", a: {b:"a"}}
p 2 == hash[1] #example
p "fifty" == hash
p "a" == hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment