Best practices - if () return
Unanswered
Great Skua posted this in #help-forum
Great SkuaOP
Hey,
VS
Can you tell me which one is the better approach? And why?
if (!event) {
return "Event not found."
}VS
if (!event) return "Event not found."Can you tell me which one is the better approach? And why?
1 Reply
both does the same thing. At the end, it comes down to code style. Many lint config forces you to add braces whereas others don't