DEV Community


Discussion on: Easy refactor ternary conditions to if else

danielpdev profile image
danielpdev Author

The code provided was just an example and not real code in production.

The real problem I had was with a nested ternary written in a string and then passed to eval. It had a real long nested conditions and babel plugin helped me refactored that code.

I agree with you, no code like that should be in a production application.