RosettaCodeData/Task/Hash-from-two-arrays/Smalltalk/hash-from-two-arrays-1.st
2023-07-01 13:44:08 -04:00

13 lines
278 B
Smalltalk

Array extend [
dictionaryWithValues: array [ |d|
d := Dictionary new.
1 to: ((self size) min: (array size)) do: [:i|
d at: (self at: i) put: (array at: i).
].
^ d
]
].
({ 'red' . 'one' . 'two' }
dictionaryWithValues: { '#ff0000'. 1. 2 }) displayNl.