I have the following code. It runs a simple function and the same function needs to run. (Recursive)
var Skit = function(callback) {
validSkit(Math.random(),function(skit,data){
// Ajax callback
if (skit == true) callback(data); // Works if skit is found
else if (skit == false) Skit(callback); // Call Skit again [not working]
});
}(function(skit){
console.log("Valid skit found!");
});
I'm getting Skit is undefined! I know I could do this true simple function Skit().. call. But this is not my requirements. Is this possible?
var Skit = function Skit(callback).(function Skit(callback){... This would be a classical named function expression.