jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
In the underscore.js library, specifically the very first function called forEach (alias for each), a test is made to check if the length property of the given object is an integer. The way it does this is not the traditional typeof check, but by using the plus operator
<script>
var foo = [];
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Traditional number check |
| ready |
Plus operator number check |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.