Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Test AAAAA
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
A
27319404.0 Ops/sec
B
3235767.0 Ops/sec
Tests:
A
const ALLOW_LETTERS = 2; const REPLACER = '*'; var value = "ok123"; var result = value.slice(0, ALLOW_LETTERS) + REPLACER.repeat(value.length - ALLOW_LETTERS);
B
const ALLOW_LETTERS = 2; const REPLACER = '*'; var value = "ok123"; var result = value.split('').map(function(letter, index) { if (index >= ALLOW_LETTERS && !/\s/.test(letter)) { return REPLACER; } return letter; }).join('');