I want to create variable which contains a function with variable input.
I tried this but no success
var setup = function( isAjaxSuccess ) {
return function( ajaxSuccess = isAjaxSuccess ){
if( ajaxSuccess === true ){
console.log("success");
} else {
console.log("error");
}
};
};
Here we call setup( true ) or setup( false ) according to which function changes. Here console.log is just for show. Here setup( true ) should return a function basically.
databeing provided?