DEV Community

Discussion on: The Life-Changing Magic of Flat Code

Collapse
 
cadams profile image
Chad Adams • Edited

This if statement

  if(!isNotUnset) {
    return null
  }

is called a guard clause like you mentioned it's a way to reduce if else blocks. In the end, it makes your code cleaner and easier to read.

Collapse
 
recursivefaults profile image
Ryan Latta

Yep, you can also vary into assertion based programming as well.