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

Code Example 1

var name: string = "Anna";
let notes: (number | string)[] = ["Get Food", 23, "Call the previous number when betting"];

Learn ReactJs, React Native from akashmittal.com