items = [1, 2, 3, "a", "b", "c", 2, 3, 4, "b", "c", "d"] d = {} for i in items d.push i end for print d.indexes