Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash get vs myget
(version: 0)
xcbdfb
Comparing performance of:
lodash vs mine
Created:
5 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script>https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.19/lodash.core.js</script>
Script Preparation code:
var a = {a:{b:{c:20}}};
Tests:
lodash
let result = _.get(a, 'a.b.c', "");
mine
const get = (mainObj, path, def=null) => { let newPath = path.replace(/\[/g,'.').replace(/\]/g, '.').split('.'); newPath.forEach(path=>{ mainObj = mainObj[path] }); if(mainObj === undefined || mainObj === null){ return def } return mainObj; }; const result = get(a, 'a.b.c', "");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
lodash
mine
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:
uniqBy performance
optional chaining vs lodash get
Lodash test suite
optional chaining chrome vs lodash get
Comments
Confirm delete:
Do you really want to delete benchmark?