Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Optional Chaining versus _.get lodash (8 levels)
(version: 0)
Comparing performance of:
Optional Chaining vs Lodash
Created:
6 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var obj = {a: {b: {c: {d: {e: {f: {g: {h: 1 }}}}}}}}
Tests:
Optional Chaining
var _obj, _obj$a, _obj$a$b, _obj$a$b$c, _obj$a$b$c$d, _obj$a$b$c$d$e, _obj$a$b$c$d$e$f, _obj$a$b$c$d$e$f$g; var res = ((_obj = obj) === null || _obj === void 0 ? void 0 : (_obj$a = _obj.a) === null || _obj$a === void 0 ? void 0 : (_obj$a$b = _obj$a.b) === null || _obj$a$b === void 0 ? void 0 : (_obj$a$b$c = _obj$a$b.c) === null || _obj$a$b$c === void 0 ? void 0 : (_obj$a$b$c$d = _obj$a$b$c.d) === null || _obj$a$b$c$d === void 0 ? void 0 : (_obj$a$b$c$d$e = _obj$a$b$c$d.e) === null || _obj$a$b$c$d$e === void 0 ? void 0 : (_obj$a$b$c$d$e$f = _obj$a$b$c$d$e.f) === null || _obj$a$b$c$d$e$f === void 0 ? void 0 : (_obj$a$b$c$d$e$f$g = _obj$a$b$c$d$e$f.g) === null || _obj$a$b$c$d$e$f$g === void 0 ? void 0 : _obj$a$b$c$d$e$f$g.h) || 2;
Lodash
_.get(obj, "a.b.c.d.e.f.g.h", 2)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Optional Chaining
Lodash
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 versus _.get lodash
Optional Chaining versus _.get lodash (with obj in the optional chain test)
ES6 Optional Chaining vs TS Optional Chaining result in javascript vs vs. Lodash _.get
Optional Chaining versus _.get lodash without badObj
Lodash _.has vs Optional Chaining
Comments
Confirm delete:
Do you really want to delete benchmark?