Apply a callback to an array: Difference between revisions

→‎{{header|Lua}}: Added note on difference between the way that Lua treats hash-table and arrays.
(→‎{{header|Lua}}: Added note on difference between the way that Lua treats hash-table and arrays.)
Line 826:
--> 1 4 9 16 25</lang>
If you used pairs() instead of ipairs(), this would even work on a hash table in general.
However, remember that hash table do not have an implicit ordering on their elements, like arrays do,
so pairs() is not guaranteed to return the elements in the same order as ipairs()
 
=={{header|M4}}==
Anonymous user