Associative array/Iteration: Difference between revisions

Add Crystal implementation
(Updated to work without warning with version 1.4 of Nim.)
(Add Crystal implementation)
Line 722:
! : 71
</pre>
 
=={{header|Crystal}}==
<lang crystal>dict = {'A' => 1, 'B' => 2}
 
dict.each { |pair|
puts pair
}
 
dict.each_key { |key|
puts key
}
 
dict.each_value { |value|
puts value
}</lang>
 
{{out}}
<pre>{'A', 1}
{'B', 2}
A
B
1
2</pre>
 
=={{header|D}}==
Anonymous user