We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I agree, the multiple return statements are a tad heavy and go against DRY coding practices. However, your recommended solution also sacrifices readability, which IMO is more important than trying to massage your code into a single statement.
Be succinct but be readable. Let your bundlers handle the optimizations.
Write a function
You are viewing a single comment's thread. Return to all comments →
I agree, the multiple return statements are a tad heavy and go against DRY coding practices. However, your recommended solution also sacrifices readability, which IMO is more important than trying to massage your code into a single statement.
Be succinct but be readable. Let your bundlers handle the optimizations.