es6-对象解构语法 (v2)

Revision 2 of this benchmark created on


Setup

const obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };  
let a, b, c, d, e;

Test runner

Ready to run.

Testing in
TestOps/sec
对象解构赋值
({ a, b, c, d, e } = obj);
ready
普通赋值
a = obj.a;
b = obj.b;
c = obj.c;
d = obj.d;
e = obj.e;
ready
对象解构赋值(通过babel转译es5)
"use strict";

var obj = {
  a: 1,
  b: 2,
  c: 3,
  d: 4,
  e: 5
};
var a, b, c, d, e;
var _obj = obj;
a = _obj.a;
b = _obj.b;
c = _obj.c;
d = _obj.d;
e = _obj.e;
_obj;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.