Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash some vs JS some 1000 entries
(version: 0)
Comparing performance of:
Lodash vs JS some
Created:
2 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
function getRandomString(length) { const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; let result = ""; for (let i = 0; i < length; i++) { const randomIndex = Math.floor(Math.random() * charset.length); result += charset.charAt(randomIndex); } return result; } function getRandomBoolean() { return Math.random() < 0.5; // Generates true or false with roughly equal probability } function generateArrayOfJSONObjects(length) { const jsonArray = []; for (let i = 0; i < length; i++) { const jsonObject = { name: getRandomString(10), // Change 10 to the desired length of the random string value: getRandomBoolean(), }; jsonArray.push(jsonObject); } return jsonArray; }
Tests:
Lodash
const array = generateArrayOfJSONObjects(1000); const found = _.some(array, s => s.value);
JS some
const array = generateArrayOfJSONObjects(1000); const found = array.some(s => s === 'oranges');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash
JS some
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:
Unique Array: Lodash vs spread new Set vs reduce vs for - random data
Native vs. Lodash ".find"
Lodash some vs JS some 1
orderBy vs array.prototype.sort vs vanila orderBy vs QuickSort
Comments
Confirm delete:
Do you really want to delete benchmark?