Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
testTatsiana
(version: 0)
Comparing performance of:
simple condition vs function
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
simple condition
const elementText = 'text' if (elementText && elementText.trim()) { return elementText.trim().toLowerCase(); }
function
const getProcessedTextIfNotEmpty = (text) => { return text && text.trim() ? text.trim().toLowerCase() : null; } const processedElementText = getProcessedTextIfNotEmpty('text'); if (processedElementText) { return processedElementText; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
simple condition
function
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Iterating over string
regex benchmark
Truncate performance
replaceall-vs-regex
Proxy overhead test vs classes
Comments
Confirm delete:
Do you really want to delete benchmark?