Top-level await: Available since 2021 in browsers, 2020 in Node.Just to clarify, these aren't "new new", they were actually released in 2021 or earlier, not 2022: Many developers utilized as an alternative IIFE (Immediately Invoked Function Expression) as a way to get access to the feature. When the async/await feature was first introduced, attempting to use an await outside of an async function resulted in a Syntaćrror. Now the await can be used at the top level of a module and can be super handy when initializing imports and creating fallbacks. This was fine until it wasn't, like when we hit the top level of our module and could not use the await keyword. Until this point, we could only use await in the scope of async functions. Private instance fields, methods, and accessors.The new ECMAScript features for this year are: Also if you want to see the ES2021 I had created the next blog post for that New JavaScript Features ECMAScript 2021 (with examples) There are some new features that have been incorporated and could be used in our javascript projects. ECMAScript 2022 is the version of ECMAScript corresponding to this year.
0 Comments
Leave a Reply. |