obj destructuring vs variable assignment

Edit on GitHub

to test whether obj destructuring is faster than manual variable assignment

Setup

var obj= {
  a: 'a',
  b: 'b',
  c: 'c'
};

Tests

  • obj destructuring

    var {a, b} = obj;
  • variable assignment

    var a = obj.a;
    var b = obj.b;