Beats 96% of JavaScript solutions, plenty of explanation
\n/**\n * @param {string} s\n * @param {string[]} words\n * @return {number}\n */\nvar numMatchingSubseq = function(s, words) {\n    // loop over each word in t
```\n/**\n * @param {string} s\n * @param {string[]} words\n * @return {number}\n */\nvar numMatchingSubseq = function(s, words) {\n    // loop over each word in the words array\n    // for a word to be a possible substring\n    // of the relative order permutations of s\n    // each letter in the word must also appear\n    // sequentially, though not adjacently\n    \n    let matches = 0;\n    \n    for (const word of words) {\n        let lastIndex = -1;\n        let match = 0;\n        \n        for (let i = 0; i < word.length; i++) {\n            const char = word.charAt(i);\n            // we can search for the position of the\n            // current char using the lastIndex observed\n            // as our starting point, which JS very\n            // conveniently provides as a parameter of indexOf\n            const currentIndex = s.indexOf(char, lastIndex + 1);\n\n            // if the index of current char is greater than the last\n            // index we observed, then the sequence persists and\n            // we can continue\n            if (currentIndex > lastIndex) {\n                match++;\n                lastIndex = currentIndex;\n            } else {\n                // otherwise, no such instance of the current char\n                // exists after the last chars index\n                break;\n            }\n        }\n        \n        // lastly, we know a valid subsequent is found if the\n        // number of local matches found is equal to the length\n        // of our word\n        if (match == word.length) {\n            matches++;\n        }\n    }\n    \n    return matches;\n};\n```
['Iterator', 'JavaScript']