VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-string-length/

⇱ JavaScript string.length - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript string.length

Last Updated : 1 Jun, 2026

The string.length is a property in JS which is used to find the length of a given string. The string.length property returns 0 if the string is empty.

Syntax:

string.length

Return Values: It returns the length of the given string.

In JavaScript arrays also have length property to find length of an array. But unlike arrays, we cannot change length of string using length properly because strings are immutable in JS.

Comment