Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Map.renameKey

renameKey($oldKey, $newKey) -> self

Description

Rename a key, while keeping the same value.

$map = { a: 1, b: 22 }

$map.rename('b', 'z')

print($map)
//= { a: 1, z: 22 }

See Also