JSFiddle - React, Tailwind, and code Playground

by ayamflow

JavaScript

console.clear();

function fastBind(func, context) {
  return function() {
    return func.apply(context, arguments);
  };
}

var Tester = function() {
  this.onClick = fastBind(this.onClick, Tester);
  console.log(this);
};

Tester.prototype.onClick = function() {
    console.log('onClick');
};

var test = new Tester();