each_idx_key_val multimethod

Methods

each_idx_key_val(h:Hash, cb:Fun) Source: stdlib.ngs:3332
Iterate a Hash.

Parameters

hHash to iterate
cbFunction 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"