Viml functional

From wikinotes

Map

let mylist = ["foo", "bar", "baz"]
echom map(mylist, {item -> item . "!"})  " [foo!, bar!, baz!]
echom map(mylist, 'v:val . "!"')         " [foo!, bar!, baz!]

Filter

let mylist = ["ditch", "KEEP", v:null, "KEEP"]
let filtered = filter(copy(mylist), 'v:val == "KEEP"')