Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
function dec vs function expr
(version: 1)
Comparing performance of:
declaration vs expression
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
declaration
for (let i = 30000; --i;) { function declaration(arg) { return arg ** 2 } declaration(i) }
expression
for (let i = 30000; --i;) { const expression = function(arg) { return arg ** 2 } expression(i) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
declaration
expression
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
declaration
39717.3 Ops/sec
expression
39658.5 Ops/sec
Related benchmarks:
test iife
function vs class
function vs const
function vs class vs arrow function
Variable Expression vs Function vs Arrow
Anon functions vs named functions
function vs class 8
Class VS Function Benchmark Test
function object vs function
Comments
Confirm delete:
Do you really want to delete benchmark?