arguments.callee alternative

javascript

Solution

This should work. But i'm not sure if it works in all browsers.

var self = this;

this.async(function someMethod(){
  if(test()){
    then();
  }else{
    self.async(someMethod);
  }
});

Problem

As `arguments.callee` is going to be deprecated, what would I use of instead of arguments.callee` in the following expression: ``` var self = this; this.async(function(){ if(test()){ then(); }else{ self.async(arguments.callee); } }); ```

Original source

Related problems