Quick string checking

Benchmark created by hippogo149 on


Setup

var a = 1;
    var b = true;
    var c = "c";
    var d = [];
    var e = {};

Test runner

Ready to run.

Testing in
TestOps/sec
typeof
if(typeof a === "string") {
}
if(typeof b === "string") {
}
if(typeof c === "string") {
}
if(typeof d === "string") {
}
if(typeof e === "string") {
}
ready
substr
if(a.substr !== undefined) {
}
if(b.substr !== undefined) {
}
if(c.substr !== undefined) {
}
if(d.substr !== undefined) {
}
if(e.substr !== undefined) {
}
ready

Revisions

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

  • Revision 1: published by hippogo149 on