HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
 
var person = {data: {type: 'Frederick'}};
Tests:
  • Lodash get string

     
    _.get(person, 'data.type');
  • Lodash get array

     
    _.get(person, ['data', 'type']);
  • Native

     
    person.data.type
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash get string
    Lodash get array
    Native

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
Firefox 96 on Ubuntu
View result in a separate tab
Test name Executions per second
Lodash get string 3109693.5 Ops/sec
Lodash get array 13527374.0 Ops/sec
Native 897828544.0 Ops/sec