Logo

Programming-Idioms

History of Idiom 13 > diff from v31 to v32

Edit summary for version 32 by :
New Lua implementation by user [jparoz]

Version 31

2016-01-05, 09:50:34

Version 32

2016-02-16, 16:58:54

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Code
for k, x in pairs(mymap) do
	print('Key: '..k..', Value: '..x)
end