I have code like this. How can I write it in cleaner, more elegant way using functional programming in JavaScript? I want to get rid of nested ternary expressions. Any ideas? This is rest of that code: EDIT: Answer Yes, but my linter is not happy: 44:16 error Do not nest ternary expressions [no-nested-ternary] If that’s your only problem then