I'm working with a function that has the following structure:
var tempFun = function() {
return 'something';
}
tempFun.priority = 100;
My goal is to store this function in an array and bind another object to it simultaneously, like so:
var funArray = [];
var newObj = {};
funArray.push( tempFun.bind(newObj) );
After this process, I want to access the function's property as follows:
funArray[0].priority
However, when I try to do this, it returns undefined. Is there a way to retain the property of the function while binding a new object to it?