Map.slice
slice($listOfKeys) -> map
Description
Get a subset of a Map for the given $listOfKeys
.
If a key is missing, the value will be filled as an empty string ''
.
$map = { a: 1, b: 2, c: 3 } $map.slice(['a', 'c']) //= { a: 1, c: 3 } // With missing key $map.slice(['a', 'X']) //= { a: 1, X: '' }