Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
matchesAny
(version: 0)
Comparing performance of:
Multiple get vs With Assignment
Created:
5 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:
const user1 = { email: null } const user2 = { email: null } function matchesAny (a, b, paths = []) { return paths.some((path) => Boolean(_.get(a, path)) && _.get(a, path) === _.get(b, path)) } function matchesAnyAssignment (a, b, paths = []) { return paths.some((path) => { const pathA = _.get(a, path) const pathB = _.get(b, path) Boolean(pathA) && pathA === pathB }) }
Tests:
Multiple get
matchesAny({email: null}, {email: null}, ['email'])
With Assignment
matchesAnyAssignment({email: null}, {email: null}, ['email'])
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Multiple get
With Assignment
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:
native find vs lodash _.find..
native find vs lodash _.find equal
aadasdsa
native find vs lodash _.find for objects equality
Lodash.get vs Lodash.property vs native test
Comments
Confirm delete:
Do you really want to delete benchmark?