JavaScript Actual Iterator - No Pre-calculation
javascript\nclass CombinationIterator {\n    \n    constructor(chars, len) {\n        this.iiterator = permute(\'\', 0);\n        this.curr = this.iiterator.nex
```javascript\nclass CombinationIterator {\n    \n    constructor(chars, len) {\n        this.iiterator = permute(\'\', 0);\n        this.curr = this.iiterator.next();\n        \n        function* permute(str, idx) {\n            if(str.length === len) yield str;\n\n            for(let i = idx; i < chars.length; i++) {\n                yield* permute(str + chars[i], i+1)\n            }\n        }\n    } \n    \n    next() {\n        const last = this.curr;\n        this.curr = this.iiterator.next();\n        return last.value;\n    }\n    \n    hasNext() {\n        return !this.curr.done;\n    } \n}\n\n```
['JavaScript']