DEV Community

Discussion on: What was the hardest concept you had to wrap your head around?

Collapse
 
elmuerte profile image
Michiel Hendriks

"Complex" boolean expressions with multiple variables, especially if it contains various not operators.

result = !(a && !b || c)
Enter fullscreen mode Exit fullscreen mode

I always have to spell or write those out to understand when result is true. I always find it best to refactor those things out of a function, into their own. And generally to avoid using double negatives.