testing for options
JavaScript performance comparison
Info
This test compares 3 ways of testing whether an options object is present.
Preparation code
<script>
Benchmark.prototype.setup = function() {
function check1(options) {
if (options) { }
}
function check2(options) {
if (options != undefined) {}
}
function check3(options) {
if (options !== undefined) {}
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
check1 |
|
pending… |
check2 |
|
pending… |
check3 |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments