对象操作-对象属性访问 (v2)

Revision 2 of this benchmark created on


Setup

const Person = {
  name: 'test',
  age: 18,
  getName: function () {
    return this.name;
  }
};

Test runner

Ready to run.

Testing in
TestOps/sec
点符号访问
const name = Person.name
const age = Person.age
const getName = Person.getName

ready
方括号访问
const name = Person['name']
const age = Person['age']
const getName = Person['getName']

ready

Revisions

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