In the past three years, JavaScriptthe syntax has been kept updated,EcmaScript and has gone through 2022???2021???2020three major versions, today I will sort out with you what are the three major versions that we should pay attention to, and you can also see which of these features are the most practical?
ES2022
Top-level await
In ES Module, you can now use await keywords directly at the top level instead of using wrapper functions to call asynchronous functions. This syntax improves to some extent the code that eliminates redundancy and simplifies how asynchronous functions are called. In addition, using the await top layer improves error handling and makes error messages easier to understand and debug.