DEV Community

Discussion on: Creating a Subscription Application with Nodejs and MongoDB

Collapse
 
bcdbuddy profile image
Babacar Cisse DIA

When you do

if (condition) {
  return something
} else { // this else is not needed
  somehtingElse
}
Enter fullscreen mode Exit fullscreen mode

You can just do

if (condition) {
  return something
}
somehtingElse
Enter fullscreen mode Exit fullscreen mode

This will help avoid deeply nested condition ie if (condition1) { if (condition2) { ...

  1. You can use markdown to put code snippets on the blog post instead of screenshots (not very clear, font is two small to read)

Nice one by the way 👍

Collapse
 
dev_tycodez profile image
Adeeyo adewale temitayo • Edited

Thanks