Learn how to find the length of a string in JavaScript.
String Length
The length property returns the length of a string:
Example
js
var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var len = txt.length;
Read more about strings in the JavaScript Strings Tutorial. Read more about the length property in the JavaScript String length Reference.