Created
April 27, 2025 15:48
-
-
Save mcsee/990c4f8dcb4bce65f6b2d2000233ff70 to your computer and use it in GitHub Desktop.
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const result = arr.filter(x => x !== null && x !== undefined) | |
.map((y) => ({ val: y.value, meta: | |
y.meta ? y.meta : {default: true}})) | |
.reduce((acc, {val, meta}) => | |
meta.default ? acc : [...acc, | |
{processed: val * 2, origin: meta}], []) | |
.some(({processed}) => processed > 10 && processed < 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment