Looking to get a head start on your next software interview? Pickup a copy of the best book to prepare: Cracking The Coding Interview!
var myString = "Hello World";
var stringLength = myString.length;
In this example, the `length` property is used to get the length of the `myString` variable, which is then assigned to the `stringLength` variable.
It’s important to note that the `length` property returns the number of characters in the string, including spaces and punctuation. So, if you have a string with 10 characters and 2 spaces, the `length` property will return 12.