Javascript incompatibility issue

I just completed a Rosetta Code challenge (ABC problem) which passes all the tests when I run it in VS Code but fails all the tests in online editor. Here’s the code I used:

function canMakeWord(word) {
  const availableBlocks = new Set(['BO','XK','DQ','CP','NA','GT','RE','TG','QD','FS','JW','HU','VI','AN','OB','ER','SF','LY','PC','ZM'])
  for (ch of word.toUpperCase()) {
    const block = [...availableBlocks].find(block => block.includes(ch));
    if (!block) return false; // Letter cannot be formed
    availableBlocks.delete(block); // Remove the used block 
  }
  return true; // All letters can be formed with available blocks
}

When I changed to use older style coding of loops, sets and searches, it passed all the tests.

Is it possible to configure Javascript to use all the modern features?

Have you looked at what is returned for one of the test cases?

console.log(canMakeWord("bark"))

Well, well - that revealed the problem: “ReferenceError: ch is not defined”. Adding let before ch of ... fixed it. It seems VS Code let me get away with it because I didn’t set “use strict”. Bad programmer! Thanks for the hint.