$() vs $([]) vs $([0]) vs $(undefined) vs $("div") vs

Benchmark created on


Description

$() vs $([]) vs $(undefined) vs $("div") vs

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
$()
(function(val) {
 val = $();
})()
ready
$([])
(function(val) {
 val = $([]);
})()
ready
$([0])
(function(val) {
 val = $([0]);
})()
ready
$(undefined)
(function(val) {
 val = $(undefined);
})()
ready
$(undefined)
(function(val) {
 val = $('div');
})()
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.