I have this:
[["hello", 1], ["world", 1]]
I want this:
{ "hello" => 1, "world" => 1 }
I've coded something that WORKS, but feels stupid. Here it is:
hash = {}
array.each do |element|
hash[element[0]] = element[1]
end
hash
Is there a better way?