confusing recursion in func-js