Skip to content

Instantly share code, notes, and snippets.

@rinchik
Created November 1, 2020 18:02
Show Gist options
  • Save rinchik/81f7b14f070270ef191e00b9688a04c8 to your computer and use it in GitHub Desktop.
Save rinchik/81f7b14f070270ef191e00b9688a04c8 to your computer and use it in GitHub Desktop.
JS poorly readable code example:
const convert = input => Object.entries(input).reduce((acc, [k, v]) => {
if (typeof v === 'number') {
acc[k] = v - 1
} else {
acc[k] = v
}
return acc
}, {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment