Skip to content

Instantly share code, notes, and snippets.

@mikedao
Created August 27, 2015 14:26
Show Gist options
  • Save mikedao/abbdb278ccf99f090813 to your computer and use it in GitHub Desktop.
Save mikedao/abbdb278ccf99f090813 to your computer and use it in GitHub Desktop.
  • Given the array ["pizza", "cheese", "steak"] Use .each to print out each word capitalized.

  • Given the array [1,2,3,4,5], use .each to create an array of each number doubled.

  • Given the array ["apple", "pie", "ice cream"], use .each to determine which string is the longest.

  • Given the array [1,2,3,4,5], use .each to give us an array consisting of only even numbers.

  • Given the array [1,2,3,4,5], use .each to give us an array consisting of numbers that are NOT even.

  • Given the array [1,1,1,3,4] use.each to give us an array consisting of how many times the nubmer 1 appears.

  • Given the array [ ['Frank', 33], ['Stacy', 15], ['Juan', 24], ['Dom', 32], ['Steve', 24], ['Jill', 24] ] use .each to determine who is the oldest.

  • Given the array [ ['Frank', 33], ['Stacy', 15], ['Juan', 24], ['Dom', 32], ['Steve', 24], ['Jill', 24] ] use .each to determine the average age.

Given the array [ ['Frank', 33], ['Stacy', 15], ['Juan', 24], ['Dom', 32], ['Steve', 24], ['Jill', 24] ] use .each to determine how many people are 24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment