Skip to content

Instantly share code, notes, and snippets.

@megstang
Created August 24, 2020 18:50
Show Gist options
  • Save megstang/088adcb7457bf2af1f46ed2eaa8406a1 to your computer and use it in GitHub Desktop.
Save megstang/088adcb7457bf2af1f46ed2eaa8406a1 to your computer and use it in GitHub Desktop.
Map Practice
  numbers = [5,1,13,2,7,9,10]
  1. Use each to return an array with every element in the numbers array doubled.
  2. Refactor the code you implemented for #1 above to use map instead of each.
  3. Use each to return true if the element is even and return false if the element is odd.
  4. Refactor the code you implemented for #3 above to use map instead of each.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment