Bind vs Self closure

Benchmark created by Sergey on


Preparation HTML

<script>
  this.a = 0;

  var binded = (function () {
    this.a = 1;
  }).bind(this);

  var self = this;
  function closured() {
    self.a = 1;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
binded
binded();
ready
closured
closured()
ready

Revisions

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