you are viewing a single comment's thread
view the rest of the comments
[–] 10 points 3 years ago

A form of "self documentation" I like to do is create variables for conditions before using it in an if statement. If you break down a funky conditional into easy to read variables it becomes a lot more clear what it's trying to do.

Idk how to write code on sync:

const isHumid = xxxx;
const isHot = yyyy;
const isSunny = zzzzz;

If (isHot && isHumid && isSunny) {
    ...
}
  • source
  • parent