List comprehensions: Difference between revisions
Content deleted Content added
→{{header|SuperCollider}}: simplified. |
|||
Line 995: | Line 995: | ||
by using concatMap / flatMap (the monadic bind function for lists), and x => [x] (monadic return for lists): |
by using concatMap / flatMap (the monadic bind function for lists), and x => [x] (monadic return for lists): |
||
<lang JavaScript> |
<lang JavaScript> (n => { |
||
'use strict'; |
|||
let flatMap = (xs, f) => [].concat.apply([], xs.map(f)), |
let flatMap = (xs, f) => [].concat.apply([], xs.map(f)), |
||