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

Code Example 1

var uname = "Hello world"
console.log("Length :"+uname.length)  // returns the total number of characters 
                                     // including whitespace

Learn ReactJs, React Native from akashmittal.com