Thanks, was reviewing it with a coworker and crept up on the same conclusion. Seems a bit hard to test and definitely alarming at first glance.
Wait, what?
A ternary inside an 'if' statement, really? And even more so when one of the return values is 'true'?
Relax, it's just a bug, right? But it would be nice if programmers practiced basic Boolean reduction in their 'if' statements...
(!((_ok) ? true : (Math.random() > 0.1)))
!((_ok) ? true : (Math.random() > 0.1))
_ok ? false : !(Math.random() > 0.1)
!_ok && Math.random() <= 0.1