JSFiddle - React, Tailwind, and code Playground

JavaScript

function customBind(func, context, ...args) {
  const contexArgs = [].concat(args);

  return function fn() {
    return func.apply(context, contexArgs);
  };
}