mapFilter

mapFilter(map map, function callback) → map filtered

Returns a new map containing all the values of the source map map for which the predicate callback returned true.

The callback function takes the arguments (value, key, map), in this order.

Example:

var map = [1: '1', 2: '2', 3: '3']
var result = mapFilter(map, function(value, key, map) {
    return key % 2 == 1
}) // [1: '1', 3: '3']
const map = new Map([ [1, '1'], [2, '2'], [3, '3'] ])
const result = new Map([...map].filter(([key]) => key % 2 === 1)) // 1 and 3
table = {1: '1', 2: '2', 3: '3'}
result = {k: v for k, v in table.items() if k % 2 == 1}  # {1: '1', 3: '3'}
Parameters
Return
Note