spader312, 10 months 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: <span style="color:#323232;">const isHumid = xxxx; </span><span style="color:#323232;">const isHot = yyyy; </span><span style="color:#323232;">const isSunny = zzzzz; </span><span style="color:#323232;"> </span><span style="color:#323232;">If (isHot && isHumid && isSunny) { </span><span style="color:#323232;"> ... </span><span style="color:#323232;">} </span>
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:
<span style="color:#323232;">const isHumid = xxxx; </span><span style="color:#323232;">const isHot = yyyy; </span><span style="color:#323232;">const isSunny = zzzzz; </span><span style="color:#323232;"> </span><span style="color:#323232;">If (isHot && isHumid && isSunny) { </span><span style="color:#323232;"> ... </span><span style="color:#323232;">} </span>