Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Map.has vs Map.get check if the key exists
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser:
Chrome 125
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
has
37282.6 Ops/sec
get
139336.7 Ops/sec
Tests:
has
const map = new Map(); map.set("foo", 1); for(let i = 0; i < 10000; i ++){ if(map.has("foo")){ } }
get
const map = new Map(); map.set("foo", 1); for(let i = 0; i < 10000; i ++){ if(map.get("foo")){ } }