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}}}}
var badObj = {}
Tests:
  • optional

     
    obj.a.b.c?.d ?? 2
  • lodash

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

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    optional
    lodash

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome 87 on Linux
View result in a separate tab
Test name Executions per second
optional 7132112.0 Ops/sec
lodash 1004431.5 Ops/sec