You are viewing a single comment's thread. Return to all comments →
I prefer map with filter. for more functionally speaking,
function addBy(num) { return (d) => d + num; } function isScored(d) { return s <= d && d <= t; } const larry = apples.map(addBy(a)).filter(isScored).length; const rob = oranges.map(addBy(b)).filter(isScored).length; console.log(larry, rob);
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
I prefer map with filter. for more functionally speaking,