String Function - length()
: StringMethod or Function
: This will count the total number of characters (length or size) present in the string and returns the value.
var ss = "a character count - size test ";
var result = ss.length;
In the above example,
- the string is stored in a variable ss.
- then the function is called as "ss.length".
- the method counts the total characters in the string and returns it.
- the result is of variable type, integer.