Fix for js lexer

The js lexer was using a for...in loop to iterate an array, which was giving me some issues on another project that uses the gherkin module. Replaced with a simple index-based iteration.