对象操作-对象创建

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Object.create() 方式
const Person = Object.create(null);
Person.name = '';
Person.age = 0;
Person.getName = function () {
  return this.name;
};
ready
对象字面量方式
const Person = {
  name: '',
  age: 0,
  getName: function () {
    return this.name;
  }
};
ready

Revisions

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