HTML Preparation code:
AخA
 
1
<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}}}}
Tests:
  • optional chaining

     
    var a = obj?.a?.b?.c?.d
  • lodash get

     
    var a = _.get(obj, "a.b.c.d")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    optional chaining
    lodash get

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Chrome 84 on Mac OS X 10.15.6
View result in a separate tab
Test name Executions per second
optional chaining 13262487.0 Ops/sec
lodash get 2147394.0 Ops/sec