You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
444 B
14 lines
444 B
'use strict';
|
|
|
|
/**
|
|
* Create a bound version of a function with a specified `this` context
|
|
*
|
|
* @param {Function} fn - The function to bind
|
|
* @param {*} thisArg - The value to be passed as the `this` parameter
|
|
* @returns {Function} A new function that will call the original function with the specified `this` context
|
|
*/
|
|
export default function bind(fn, thisArg) {
|
|
return function wrap() {
|
|
return fn.apply(thisArg, arguments);
|
|
};
|
|
}
|
|
|