Create a hash from an array of keys September 25, 2023 by Tarik My solution, one among the others 🙂 a = ["a", "b", "c", "d"] h = Hash[a.map {|x| [x, 1]}]