value of date input to date object (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script>
var valueOfDateInput = "2013-06-11";

function a(str) {
    return new Date(str.split('-').join('/'));
}

function b(str) {
    var parts = "2013-06-11".split('-');
    return new Date(parts[0], parts[1]-1, parts[2])
}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
a
a(valueOfDateInput);
ready
b
b(valueOfDateInput);
ready

Revisions

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