Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
Chrome 72
Mac OS X 10.14.3
Desktop
5 years ago
Test name Executions per second
Direct Access 16106138.0 Ops/sec
Defensive Check for Existence with If-Statement 3982528.8 Ops/sec
Defensive Check for Existence Using `hasOwnProperty` with If-Statement 1741473.2 Ops/sec
Defensive Check for Existence without If-Statement 5046623.0 Ops/sec
Defensive Check for Existence Using `hasOwnProperty` without If-Statement 2019587.5 Ops/sec
Script Preparation code:
Tests:
  • Direct Access

  • Defensive Check for Existence via If-statement

  • Defensive Check for Existence via If-statement using `hasOwnProperty`

  • Defensive Check for Existence via Chaining

  • Defensive Check for Existence via Chaining using `hasOwnProperty`


;