Created
November 1, 2020 18:02
-
-
Save rinchik/81f7b14f070270ef191e00b9688a04c8 to your computer and use it in GitHub Desktop.
JS poorly readable code example:
This file contains 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 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