5 ms·
I actually thought Math.max was faster in modern Chrome than a ternary.
by drawfloat 4y ago
I actually thought Math.max was faster in modern Chrome than a ternary.
- hajile 4y agoYou can try for yourself (this uses an if..else, but they compile to the same thing) https://www.measurethat.net/Benchmarks/Show/6528/0/mathmin-vs-ifelse-vs-ternary-operator https://www.measurethat.net/Benchmarks/Show/6528/0/mathmin-v...