Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash's get vs optional chaining (?.)
(version: 0)
Comparing performance of:
Optional Chaining (?.) vs Lodash _.get()
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:
var obj = {a: {b: {c: {d: 1}}}} var badObj = {}
Tests:
Optional Chaining (?.)
const test1 = obj?.a?.b?.c?.d ?? null; const test2 = badObj?.a?.b?.c?.d ?? null;
Lodash _.get()
const test1 = _.get(obj, "a.b.c.d", null); const test2 = _.get(badObj, "a.b.c.d", null);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Optional Chaining (?.)
Lodash _.get()
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:
optional chaining vs lodash get
ES6 Optional Chaining vs TS Optional Chaining result in javascript vs vs. Lodash _.get
Manual optional Chaining versus _.get lodash versus ? optional chaining
optional chaining chrome vs lodash get
Lodash _.has vs Optional Chaining
Comments
Confirm delete:
Do you really want to delete benchmark?