For example , in JavaScript , the factor function can be defined as anonymous via such a recursion : For example , in JavaScript the factorial function can be defined via such recursion as anonymous :