![]() ![]() You may want to support multiple browsers, and multiple versions of each browser. For a web browser, it's a little more complicated. So, it easy to know which features are supported. ![]() If you use NodeJS, it also uses V8, the JS engine of Chromium. For instance, if you choose Electron, you know it uses Chromium version XXX so you know which functionalities are available. Depending on this choice, you know the JS flavor you can use. Do you need to run your application in a web browser and which one, in NodeJS or Electron. Let's see how to choose the right version! #Select your target JS runtimeįirst, you must know which runtime you want to support. So, if you can target ES Next, do it! Unfortunately, this is not always possible. For instance, you can blackbox tslib if you import TypeScript helpers. The source map can sometimes help, but it doesn't solve all issues. So, the call stack is harder to understand, stepping into the next statement is not easy because you have to step into the step machine functions. For instance, async/await is rewritten by TypeScript to a state machine. It's not only shorter, but also easier to debug. Using the highest version allows you to write shorter code, and use more readable features, such as async/await, for.of, spread, etc. But which version should you target? #Why you should use the highest possible version? TypeScript allows converting most of the ES next features to ES3, ES5, ES6, ES2016, ES2017. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |