map.get()
The modified map.get()
function returns the value associated with $key
in $map
, and returns $fallback
if returned is null
.
Modified by removing arbitrary argument $keys...
and instead, adding $fallback
value. To get the nested value use key as comma-separated list. This way of providing key as comma-separated list is consistent with map.remove()
and map.set()
functions.
Parameters
$map
$map
A map to get the value by using $key
.
$key
$key
The key used to get the value from $map
.
$fallback: null
$fallback: null
The fallback value if returned is null
.
Return
The return value is the value associated with $key
from $map
, if null
returns $fallback
.
Examples
Last updated
Was this helpful?