Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
underscore isString VS typeof
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
underscore check 1
4874355.5 Ops/sec
underscore check 2
4235609.5 Ops/sec
native check 1
7773351.5 Ops/sec
native check 2
7791405.5 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js" integrity="sha512-2V49R8ndaagCOnwmj8QnbT1Gz/rie17UouD9Re5WxbzRVUGoftCu5IuqqtAM9+UC3fwfHCSJR1hkzNQh/2wdtg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Script Preparation code:
var MyObject = { description: 'a', myNumber: 123456789, myBoolean: true, }; var myString = "abcdef" var myCopy = null;
Tests:
underscore check 1
myCopy = _.isString(MyObject);
underscore check 2
myCopy = _.isString(myString);
native check 1
myCopy = typeof MyObject === 'string'
native check 2
myCopy = typeof myString === 'string'