4 ms·
In that case, use var. There is no production ready polyfill for let. I'd recommend editing your original question and putting your requirement of not using any
by acoard 9y ago
In that case, use var. There is no production ready polyfill for let. I'd recommend editing your original question and putting your requirement of not using any buildtools or transpillation in, because it's the salient factor here and for most questions you'd ask regarding JS.
>but I think one of the perks of writing in JavaScript was that I got to have a high level language directly run by a system and now I don't want to give it up.
Out of curiosity, what do you see you're giving up? Is it the theoretical knowledge that the code exactly as written is being interpreted? I find that the compiled code is very human readable nowadays, and with sourcemaps it's not an issue at all as browser dev tools will directly link to the source files instead of the compiled files. I used to think I was giving up something until I worked with such a setup.
- placebo 9y agosorry, missed your reply (so perhaps you won't see this for the same reasons) but anyway: Mainly the feeling of giving up simplicity. Adding things (such as sourcemaps and any relevant configuration changes) usually detracts from the sense of "no middleman", although I know "no middleman" is always an illusion, it's less obvious when you don't have to do anything to create it.