Methods

each_idx_key_valΒΆ

each_idx_key_val(h:Hash, cb:Fun)

Iterate a Hash.
Source: stdlib.ngs:1616

h

Hash to iterate

cb

Function to call with successive indexes, keys and values

Returns

h

Example

{"a": 1, "b": 2}.each_idx_key_val(F(idx, k, v) echo("[$idx] $k=$v"))
# Outputs: "[0] a=1" and on the next line "[1] b=2"