3 ms·
Haha oh yeah, `Math.round` was also wrong. Didn't see that one. `|0` is a good trick, I'll have to remember that.
by nathan_f77 10y ago
Haha oh yeah, `Math.round` was also wrong. Didn't see that one.
`|0` is a good trick, I'll have to remember that.
- uniclaude 10y ago|0 also has the benefit of making your code harder to read and look smart. </s> I wouldn't recommend using this unless you're trying to shove milliseconds in this type of operations.
- JSDave 10y agoYou're in the wrong place. If anyone was going for readability, it'd just be _.sample(['red', 'blue', 'yellow']). 0 chance of OP's bug, 0 chance of nathan's bug. Understand exactly what's going on as soon as you finish physically reading it.
- beaconstudios 10y ago> when the senior developer does the code review
- unwind 10y ago*shave, right? Shoving (in) milliseconds would make it slower. :)