HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
let detailsCon = {
    images: [{
        imageUrl: 'Test'
    }]
};
Tests:
  • Lodash

     
    let detailsCon = {
        images: [{
            imageUrl: 'Test'
        }]
    };
    let ldValue = _.get(detailsCon, 'images[0].imageUrl', '')
  • Javascript

     
    let detailsCon = {
        images: [{
            imageUrl: 'Test'
        }]
    };
    let imgSrc = detailsCon && detailsCon.images && detailsCon.images[0] && detailsCon.images[0].imageUrl ?
                detailsCon.images[0].imageUrl : '';
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash
    Javascript

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
Chrome 84 on Windows
View result in a separate tab
Test name Executions per second
Lodash 1143647.0 Ops/sec
Javascript 114911544.0 Ops/sec