Thank you. This makes a lot of sense. I need to think it through since 'let' is one of the things about modern JavaScript that I quite like, so I need to decide whether I really want to go back to using 'var' again.
To be honest, I resisted adopting ES6 features for quite a long time because I was concerned about exactly this kind of situation, where a modern feature might not work in an older browser that is still in use. However, in 2022, prompted by ESLint's no-var rule [1], I began using ES6 features in my code [2]. Now I find myself wondering whether my earlier, more conservative approach to JavaScript might have been the better approach.
In any case, thank you very much for following up on this thread. It has given me something to think about.
[1] https://eslint.org/docs/latest/rules/no-var
[2] https://codeberg.org/susam/texme/commit/8e31dbf