Typescript Best Practices
<p>I have been extensively using Typescript since the beginning of this year. The reason for this can be attributed to its popularity, as it was ranked 4th in <a href="https://octoverse.github.com/2022/top-programming-languages" rel="noopener ugc nofollow" target="_blank">Github’s language rankings for 2022</a>. Additionally, it appears on most job descriptions, <a href="https://www.devjobsscanner.com/blog/top-8-most-demanded-languages-in-2022/" rel="noopener ugc nofollow" target="_blank">with over 801,000 job offers explicitly requiring Javascript or Typescript as a programming language between October 2021 and November 2022, accounting for 31% of all job offers</a>. Therefore, it is a language that cannot be ignored. Most importantly though, Typescript is a superset of Javascript, suitable for building large scale applications due to its strongly typed feature that makes debugging easier. It’s javascript with more features. You can compile a program in Javascript and save it as a .ts extension instead of .js and it will work well.</p>
<p>Some of the benefits that Typescript adds on top of Javascript include:</p>
<ul>
<li><strong>Type Annotations(:Type) — </strong>The ability to declare type values in order to make your source code a lot more readable and error-free.</li>
</ul>
<p>For instance:</p>
<p><img alt="type example that takes in two parameters: a number id and a string name." src="https://miro.medium.com/v2/resize:fit:364/1*5nRDASMjN_qMZ5VsPCQQCw.png" style="height:132px; width:405px" /></p>
<ul>
<li><strong>Type Aliases</strong> — The ability to create data types that can be reused throught the source code.</li>
</ul>
<p><a href="https://medium.com/@sobitdaniel/typescript-best-practices-610e8facb8df">Visit Now</a> </p>