recursive javascript impl

explicit recursion example