How Has JavaScript Changed in the Last Few years?

<p>In the past three years,&nbsp;<code><strong>JavaScript</strong></code>the syntax has been kept updated,<code><strong>EcmaScript</strong></code>&nbsp;and has gone through&nbsp;<code><strong>2022、2021、2020</strong></code>three 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?</p> <h1>ES2022</h1> <h1>Top-level await</h1> <p>In&nbsp;<code><strong>ES Module</strong></code>, you can now use&nbsp;<code><strong>await</strong></code>&nbsp;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&nbsp;<code><strong>await</strong></code>&nbsp;top layer improves error handling and makes error messages easier to understand and debug.</p> <p><a href="https://javascript.plainenglish.io/how-has-javascript-changed-in-the-last-few-years-490394d460e5">Website</a></p>