DEV Community

Discussion on: JS Refactoring Combo: Simplify Duplicated Function Call Inside If-Else Statement

Collapse
 
loucyx profile image
Lou Cyx

You could just use GitHub Copilot as well:

Demo of GitHub copilot turning an if into a ternary

It actually shines with those kind of refactors.

Collapse
 
lgrammel profile image
Lars Grammel

That's pretty cool!