Recursive version of js-length.