Created
October 19, 2018 16:52
-
-
Save rodloboz/9088decfe32fe7ea3a6a49664beb1014 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#. 0. 1 | |
students = [ | |
["john", 28], | |
["mary", 22], | |
["peter", 18] | |
] | |
# TODO: transform student into an array of hashes | |
students_hash = students.map do |student| | |
{ | |
name: student[0], | |
age: student[1] | |
} | |
end | |
p students | |
p students_hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment