JSFiddle - React, Tailwind, and code Playground

by kpulkit29

JavaScript

Function.prototype.applyCustom = function(ref, args) {
		this.call(ref, ...args);
}

Function.prototype.callCustom = function(ref, ...args) {
		this.apply(ref, args);
}

Function.prototype.bindCustom = function(ref) {
		let self = this;
		return function(...args) {
    	self.call(ref, ...args);
    }
}

function at(param1, param2) {
    console.log(this.val, param1, param2);
}

at.bindCustom({val:5})(2,4);