Skip to content

Instantly share code, notes, and snippets.

@mcsee
Created April 27, 2025 15:48
Show Gist options
  • Save mcsee/990c4f8dcb4bce65f6b2d2000233ff70 to your computer and use it in GitHub Desktop.
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
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