Comparison of comparisons (v9)

Revision 9 of this benchmark created by Lil Devil on


Setup

var teststr = "test text",
        testnum = 132013223,
        teststrnum = "132013223";

Test runner

Ready to run.

Testing in
TestOps/sec
== String (true)
(teststr == "test text");
ready
=== String (true)
(teststr === "test text");
ready
== String (false)
(teststr == "not test text");
ready
=== String (false)
(teststr === "not test text");
ready
== Number (true)
(testnum == 132013223);
ready
=== Number (true)
(testnum === 132013223);
ready
== Number (false)
(testnum == 13201322);
ready
=== Number (false)
(testnum === 13201322);
ready
string == number (true)
(teststrnum == testnum);
ready
string === number (true)
(teststrnum === testnum);
ready
string == number (false)
(teststr == testnum);
ready
string === number (false)
(teststr === testnum);
ready

Revisions

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