对象操作-对象方法调用

Benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
点符号调用
const name = Person.getName()
ready
方括号调用
const name = Person['getName']()
ready

Revisions

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