Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Chrome 87
Windows
Desktop
4 years ago
Test name Executions per second
dot 8957549.0 Ops/sec
destructure 8872720.0 Ops/sec
Script Preparation code:
AخA
 
var object = {
    data: {
        one: {
            two: {
               three: 4
            }
        }
    },
};
Tests:
  • dot

     
    const data = object.data;
    const one = data.one;
    const two = one.two;
    const three = two.three;
  • destructure

     
    const { data } = object;
    const { one } = data;
    const { two } = one;
    const { three } = two;