Check out example codes for "install typescript homebrew". It will help you in understanding the concepts better.

Code Example 1

Type the following command in the terminal (Mac only):

brew install typescript

Learn ReactJs, React Native from akashmittal.com