• RSS Unknown Feed

    • An error has occurred; the feed is probably down. Try again later.
  • Meta

How to Get the Length of a String in JavaScript

To retrieve the length of a JavaScript string, access the length property of the JavaScript string object, as follows:

var strTest = 'Joey JavaScript';
document.write(strTest.length);

Note that an empty string has a length of 0.

Leave a comment