Logo

Programming-Idioms

History of Idiom 189 > diff from v7 to v8

Edit summary for version 8 by emrahb:
New JS implementation by user [emrahb]

Version 7

2019-09-27, 13:26:52

Version 8

2019-09-27, 13:31:59

Idiom #189 Filter and transform list

Produce a new list y containing the result of function T applied to all elements e of list x that match the predicate P.

Idiom #189 Filter and transform list

Produce a new list y containing the result of function T applied to all elements e of list x that match the predicate P.

Extra Keywords
map apply
Extra Keywords
map apply
Code
y = x.filter(i => P(i)).map(i => T(i))