The String length Property

By: Dusty Arlia
Published on Saturday, March 30, 2013, 05:37 PM
Last Updated on Thursday, July 16, 2015 at 9:54 PM
Total Updates: 2

The string length property provides the length of a string. Here is an example:

var first_name_length = "Dusty".length;

This example should return 5, the length of the string "Dusty". The length property can also be used on variables. For example:

var full_name = "Dusty Arlia";
var full_name_length = full_name.length;
document.write(full_name_length); //should print 11