Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
var-let-const4
(version: 0)
Comparing performance of:
const vs let vs var
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
function withConst(a,b) { const x = a + '10'; return x + b; } function withLet(a,b) { let x = a + '10'; return x + b; } function withVar(a,b) { var x = a + '10'; return x + b; }
Tests:
const
withConst(Math.random(), Math.random())
let
withLet(Math.random(), Math.random())
var
withVar(Math.random(), Math.random())
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
const
let
var
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 OPR/113.0.0.0
Browser/OS:
Opera 113 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
const
3729430.0 Ops/sec
let
3374979.0 Ops/sec
var
2928615.0 Ops/sec
Related benchmarks:
var vs. const vs. let
new const vs reassigning let vs reassigning var
Const vs VAR vs LET full
let vs const in tight loops
Comments
Confirm delete:
Do you really want to delete benchmark?